|
|
@@ -13,12 +13,12 @@
|
|
|
<span>注册帐号</span>
|
|
|
</div>
|
|
|
<div class="text item">
|
|
|
- <el-form ref="form" :model="userRegistry" label-width="100px">
|
|
|
- <el-form-item label="邮箱/手机号" label-width="100px">
|
|
|
+ <el-form v-if="registryEnable" ref="form" :model="userRegistry" label-width="100px">
|
|
|
+ <el-form-item label="帐号" label-width="90px">
|
|
|
<el-input
|
|
|
v-model="userRegistry.principal"
|
|
|
placeholder="请输入邮箱或手机号"
|
|
|
- style="width: 45%; padding-right: 10px"
|
|
|
+ style="width: 45%; padding-right: 5px"
|
|
|
clearable
|
|
|
/>
|
|
|
<el-button :disabled="isBtn" @click="registerVerifyCode">{{ code }}</el-button>
|
|
|
@@ -31,7 +31,7 @@
|
|
|
clearable
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="密码">
|
|
|
+ <el-form-item label="密码" label-width="90px">
|
|
|
<el-input
|
|
|
v-model="userRegistry.credential"
|
|
|
type="password"
|
|
|
@@ -49,15 +49,12 @@
|
|
|
clearable
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- :loading="isLoading"
|
|
|
- @click.native="registerBtn"
|
|
|
- >注册</el-button>
|
|
|
- <el-button type="plain" @click="login">返回登入</el-button>
|
|
|
- </el-form-item>
|
|
|
</el-form>
|
|
|
+ <div v-else class="text item">
|
|
|
+ <span>系统当前未开放注册</span>
|
|
|
+ </div>
|
|
|
+ <el-button v-if="registryEnable" type="primary" :loading="isLoading" @click.native="registerBtn">注册</el-button>
|
|
|
+ <el-button type="plain" @click="login">返回登入</el-button>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</el-row>
|
|
|
@@ -70,6 +67,7 @@
|
|
|
<script>
|
|
|
import { userMixin } from 'assets/js/mixin'
|
|
|
import LoginBar from 'components/layout/LoginBar'
|
|
|
+import { getRegistryStatus } from '@/api/account'
|
|
|
|
|
|
export default {
|
|
|
name: 'Register',
|
|
|
@@ -77,20 +75,33 @@ export default {
|
|
|
LoginBar
|
|
|
},
|
|
|
mixins: [userMixin],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ registryEnable: false
|
|
|
+ }
|
|
|
+ },
|
|
|
watch: {
|
|
|
$route() {
|
|
|
this.$router.go()
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
created() {
|
|
|
document.title = '注册帐号'
|
|
|
- this.fetchPubkey(2)
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- }
|
|
|
},
|
|
|
methods: {
|
|
|
+ getData() {
|
|
|
+ getRegistryStatus().then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.registryEnable = resp.data
|
|
|
+ if (this.registryEnable) {
|
|
|
+ this.fetchPubkey(2)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
login() {
|
|
|
this.$router.push('/login')
|
|
|
}
|