代码调整

This commit is contained in:
joylink_cuiweidong 2022-12-13 17:28:57 +08:00
parent 6a89850696
commit 4985423186

View File

@ -66,7 +66,7 @@
</el-button>
</el-form-item>
<div style="display: flex;justify-content: space-around;margin-top:40px;">
<el-button type="primary" size="small" @click="submitForm()">立即创建</el-button>
<el-button type="primary" size="small" :loading="loading" @click="submitForm()">立即创建</el-button>
<el-button size="small" @click="doClose()">返回登录</el-button>
</div>
</el-form>
@ -129,6 +129,7 @@ export default {
passWordCodeTime: 0,
passWordTime: null,
message: '',
loading:false,
operation: '',
title: '账号注册',
form: {
@ -270,11 +271,19 @@ export default {
} else {
data.email = this.form.email;
}
this.loading = true;
registerUserNew(data).then(resp => {
this.loading = false;
this.$message.success('账号注册成功!' );
this.doClose();
}).catch(error => {
this.$message.error('账号注册失败:' + error.message);
this.loading = false;
if (error.code == '10012') {
this.$message.error('账号注册失败:账号已存在');
} else {
this.$message.error('账号注册失败:' + error.message);
}
});
}
});