diff --git a/traffic-back/src/main/java/com/springboot/traffic/controller/trafficController.java b/traffic-back/src/main/java/com/springboot/traffic/controller/trafficController.java index 7ec44ee..d7edfb1 100644 --- a/traffic-back/src/main/java/com/springboot/traffic/controller/trafficController.java +++ b/traffic-back/src/main/java/com/springboot/traffic/controller/trafficController.java @@ -18,10 +18,24 @@ public class trafficController { @Autowired trafficService trafficService; - //登录验证 + /**用户注册**/ + @RequestMapping(value = "/register", method = {RequestMethod.POST,RequestMethod.GET}) + @ResponseBody + public Map register(@RequestBody Map param) { + Map result = null; + try { + result = trafficService.register(param); + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + + /**登录验证*/ @RequestMapping(value = "/login", method = {RequestMethod.POST, RequestMethod.GET}) @ResponseBody - public Map hello(@RequestBody Map param) { + public Map login(@RequestBody Map param) { Map result = new HashMap<>(); result = trafficService.getUser(); return result; diff --git a/traffic-back/src/main/java/com/springboot/traffic/dao/mapping/trafficMapper.xml b/traffic-back/src/main/java/com/springboot/traffic/dao/mapping/trafficMapper.xml index 25955c5..cfb5ec0 100644 --- a/traffic-back/src/main/java/com/springboot/traffic/dao/mapping/trafficMapper.xml +++ b/traffic-back/src/main/java/com/springboot/traffic/dao/mapping/trafficMapper.xml @@ -1,6 +1,16 @@ + + insert into traffic_user(user_id,user_name,user_password,user_phone) + values + ( + uuid(), + #{formName.name}, + #{formName.pass}, + #{formName.phone} + ) + diff --git a/traffic-back/src/main/java/com/springboot/traffic/dao/trafficMapper.java b/traffic-back/src/main/java/com/springboot/traffic/dao/trafficMapper.java index 4e6af6d..d33a1bc 100644 --- a/traffic-back/src/main/java/com/springboot/traffic/dao/trafficMapper.java +++ b/traffic-back/src/main/java/com/springboot/traffic/dao/trafficMapper.java @@ -7,5 +7,12 @@ import java.util.Map; @Mapper public interface trafficMapper { + + /**用户注册 + * @param param**/ + int userRegister(Map param); + List> getUser(); + + } 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 b31ea93..cdb1789 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 @@ -14,6 +14,16 @@ public class trafficServiceImpl implements trafficService { @Autowired trafficMapper trafficMapper; + @Override + public Map register(Map param) { + Map result = new HashMap<>(); + int res = 0; + res = trafficMapper.userRegister(param); + result.put("success",true); + result.put("data",res); + return result; + } + @Override public Map getUser() { Map result = new HashMap<>(); 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 cd84b65..47590e1 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,9 +3,14 @@ package com.springboot.traffic.service; import java.util.Map; public interface trafficService { + + Map register(Map param); + /** * * @return */ Map getUser(); + + } diff --git a/traffic-front/src/components/DiscardQuery.vue b/traffic-front/src/components/DiscardQuery.vue index 92e5d72..e41b514 100644 --- a/traffic-front/src/components/DiscardQuery.vue +++ b/traffic-front/src/components/DiscardQuery.vue @@ -1,9 +1,150 @@ + diff --git a/traffic-front/src/components/Guide.vue b/traffic-front/src/components/Guide.vue index 213d37e..19e5937 100644 --- a/traffic-front/src/components/Guide.vue +++ b/traffic-front/src/components/Guide.vue @@ -1,9 +1,79 @@ diff --git a/traffic-front/src/components/Homepage.vue b/traffic-front/src/components/Homepage.vue index 5c285a8..911a8bd 100644 --- a/traffic-front/src/components/Homepage.vue +++ b/traffic-front/src/components/Homepage.vue @@ -1,7 +1,7 @@