|
|
@@ -396,25 +396,38 @@ export default {
|
|
|
this.$refs.registerForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|
|
|
+
|
|
|
this.$http
|
|
|
- .post(
|
|
|
- '/user/regOrganization',
|
|
|
- // {
|
|
|
- // username: this.registerInfo.username,
|
|
|
- // password: this.registerInfo.password
|
|
|
- // },
|
|
|
- this.registerInfo,
|
|
|
- { body: 'json' }
|
|
|
- )
|
|
|
+ .get('/organization/byName', { name: this.registerInfo.organizationName }, { body: 'json' })
|
|
|
.then(res => {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success('注册成功');
|
|
|
- this.register = false;
|
|
|
+ if (res != null || res != 'undefind') {
|
|
|
+ this.$confirm('该承办单位已有人注册,注册手机号为' + res + ',是否继续注册', '提示', {
|
|
|
+ confirmButtonText: '继续注册',
|
|
|
+ cancelButtonText: '返回登录',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$http
|
|
|
+ .post('/user/regOrganization', this.registerInfo, { body: 'json' })
|
|
|
+ .then(res => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success('注册成功');
|
|
|
+ this.register = false;
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loading = false;
|
|
|
+ this.register = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
})
|
|
|
.catch(e => {
|
|
|
console.log(e);
|
|
|
this.loading = false;
|
|
|
- this.$message.error(e.error);
|
|
|
});
|
|
|
}
|
|
|
});
|