1
zj
2024-05-22 9d7cdb2c01a468b7e722912fc0aae1ab5263ca91
src/main/java/com/nq/controller/UserApiController.java
@@ -57,10 +57,45 @@
    //注册
    @RequestMapping(value = {"reg.do"}, method = {RequestMethod.POST})
    @ResponseBody
    public ServerResponse reg(@RequestParam("agentCode") String agentCode, @RequestParam("phone") String phone, @RequestParam(value = "yzmCode", defaultValue = "") String yzmCode, @RequestParam("userPwd") String userPwd, HttpServletRequest httpServletRequest) {
        return this.iUserService.reg(yzmCode, agentCode, phone, userPwd, httpServletRequest);
    public ServerResponse reg(@RequestParam("agentCode") String agentCode,
                              @RequestParam("phone") String phone,
                              @RequestParam("phoneCode") String phoneCode,
                              @RequestParam("userPwd") String userPwd,
                              HttpServletRequest httpServletRequest) {
        return this.iUserService.reg(agentCode, phone,phoneCode, userPwd,httpServletRequest);
    }
    @RequestMapping(value = {"sendMailCode.do"}, method = {RequestMethod.POST})
    @ResponseBody
    public ServerResponse sendMailCode(@RequestParam("email") String email) {
        try {
            if (email == null || email.isEmpty()) { // 判断email参数是否为空
                return ServerResponse.createByErrorMsg("邮箱不能为空");
            }
            log.info("-------->发送邮件");
            return this.iUserService.sendMailCode(email);
        } catch (Exception e) {
            e.printStackTrace();
            return ServerResponse.createByErrorMsg("发送失败,发生异常");
        }
    }
    @RequestMapping(value = {"sendSms.do"}, method = {RequestMethod.POST})
    @ResponseBody
    public ServerResponse sendSms(@RequestParam("phone") String phone,HttpServletRequest request) {
        try {
            if (phone == null || phone.isEmpty()) {
                return ServerResponse.createByErrorMsg("手机号不能为空",request);
            }
            log.info("-------->发送短信");
            return this.iUserService.sendSms(phone,request);
        } catch (Exception e) {
            e.printStackTrace();
            return ServerResponse.createByErrorMsg("发送失败,发生异常");
        }
    }
    //登录
    @RequestMapping(value = {"login.do"}, method = {RequestMethod.POST})
    @ResponseBody