From 6c02d62343f7975660d0fa55b8835614761bfa84 Mon Sep 17 00:00:00 2001 From: peihaoyu <617594538@qq.com> Date: Wed, 20 May 2020 08:02:05 +0800 Subject: [PATCH] '20200520' --- .../service/impl/trafficServiceImpl.java | 6 +- .../traffic/service/trafficService.java | 3 +- traffic-front/src/components/Background.vue | 11 -- .../src/components/IllegalProcess.vue | 111 +++++++++++++++++- traffic-front/src/components/index.vue | 12 +- traffic-front/src/router/index.js | 7 +- 6 files changed, 128 insertions(+), 22 deletions(-) delete mode 100644 traffic-front/src/components/Background.vue diff --git a/traffic-back/src/main/java/com/springboot/traffic/service/impl/trafficServiceImpl.java b/traffic-back/src/main/java/com/springboot/traffic/service/impl/trafficServiceImpl.java index cdb1789..68910ba 100644 --- a/traffic-back/src/main/java/com/springboot/traffic/service/impl/trafficServiceImpl.java +++ b/traffic-back/src/main/java/com/springboot/traffic/service/impl/trafficServiceImpl.java @@ -18,7 +18,11 @@ public class trafficServiceImpl implements trafficService { public Map register(Map param) { Map result = new HashMap<>(); int res = 0; - res = trafficMapper.userRegister(param); + try { + res = trafficMapper.userRegister(param); + } catch (Exception e) { + e.printStackTrace(); + } result.put("success",true); result.put("data",res); return result; diff --git a/traffic-back/src/main/java/com/springboot/traffic/service/trafficService.java b/traffic-back/src/main/java/com/springboot/traffic/service/trafficService.java index 47590e1..2e0b3c2 100644 --- a/traffic-back/src/main/java/com/springboot/traffic/service/trafficService.java +++ b/traffic-back/src/main/java/com/springboot/traffic/service/trafficService.java @@ -3,7 +3,8 @@ package com.springboot.traffic.service; import java.util.Map; public interface trafficService { - + + /**用户注册**/ Map register(Map param); /** diff --git a/traffic-front/src/components/Background.vue b/traffic-front/src/components/Background.vue deleted file mode 100644 index da0d320..0000000 --- a/traffic-front/src/components/Background.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - - - diff --git a/traffic-front/src/components/IllegalProcess.vue b/traffic-front/src/components/IllegalProcess.vue index 2a3e2c2..82b0f8c 100644 --- a/traffic-front/src/components/IllegalProcess.vue +++ b/traffic-front/src/components/IllegalProcess.vue @@ -1,9 +1,118 @@ diff --git a/traffic-front/src/components/index.vue b/traffic-front/src/components/index.vue index 2f7ee41..735d658 100644 --- a/traffic-front/src/components/index.vue +++ b/traffic-front/src/components/index.vue @@ -59,7 +59,6 @@ 在线留言 办事指南 - 后台管理 @@ -169,9 +168,18 @@ export default { this.dialogLogonVisible = true; }, + //用户注册 submitRegister(formName) { this.$ajax.post("/traffic/register",{formName},r=>{ - this.dialogRegisterVisible = false; + if(r===1){ + this.dialogRegisterVisible = false; + this.$message({ + message: '注册成功!', + type: 'success' + }); + } else{ + this.$message.error('用户名已存在!'); + } },r=>{ }) diff --git a/traffic-front/src/router/index.js b/traffic-front/src/router/index.js index 0b4837a..2ca0429 100644 --- a/traffic-front/src/router/index.js +++ b/traffic-front/src/router/index.js @@ -13,7 +13,7 @@ export default new Router({ { path: 'homepage', name: 'homepage', - + component:() => import('@/components/Homepage') }, { @@ -50,11 +50,6 @@ export default new Router({ path: 'guide', name: 'guide', component:() => import('@/components/Guide') - }, - { - path: 'background', - name: 'background', - component:() => import('@/components/Background') } ] }