Skip to content
This repository was archived by the owner on Jun 14, 2021. It is now read-only.

Commit 62b7fa9

Browse files
committed
feat: auto hide invitation code input
1 parent 795ebea commit 62b7fa9

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/components/SignUp.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
<a-input v-model="username" placeholder="Username" />
77
<br /><br />
88
<a-input v-model="password" type="password" placeholder="Password" @keyup.enter="handleSubmit" />
9-
<br /><br />
10-
<a-input v-model="code" placeholder="Invitation Code" />
9+
<template v-if="!allowSignup">
10+
<br /><br />
11+
<a-input v-model="code" placeholder="Invitation Code" />
12+
</template>
1113
<br /><br />
1214
<a-button v-on:click="handleSubmit" type="primary">Sign up</a-button>
1315
</div>
@@ -20,7 +22,8 @@
2022
return {
2123
username: '',
2224
password: '',
23-
code: ''
25+
code: '',
26+
allowSignup: false
2427
}
2528
},
2629
@@ -44,8 +47,13 @@
4447
}
4548
},
4649
47-
created: () => {
50+
created: function () {
4851
document.title = 'Sign Up | JAVClub'
52+
this.axios.get(this.apiHost + '/auth/getStatus').then((res) => {
53+
res = res.data
54+
55+
this.allowSignup = res.data.allowSignup
56+
})
4957
}
5058
}
5159
</script>

0 commit comments

Comments
 (0)