licailing %!s(int64=4) %!d(string=hai) anos
pai
achega
bd53be1b89

+ 1 - 0
src/main/java/com/izouma/wenlvju/security/WebSecurityConfig.java

@@ -73,6 +73,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/programme/getShow/**").permitAll()
                 .antMatchers("/programme/getAuth").permitAll()
                 .antMatchers("/programme/getScore/**").permitAll()
+                .antMatchers("/organization/byName").permitAll()
                 .antMatchers("/programmeScore/breakdown").permitAll()
                 .antMatchers("/participant/byProgramme").permitAll()
                 .antMatchers("/upload/**").permitAll()

+ 26 - 13
src/main/vue/src/views/Login.vue

@@ -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);
                         });
                 }
             });