1
zj
2024-06-03 4f0c87bbb84270e7b1dc3bd8dc1a4aa7ced128e7
src/main/java/com/nq/controller/UserApiController.java
@@ -59,17 +59,40 @@
    @ResponseBody
    public ServerResponse reg(@RequestParam("agentCode") String agentCode,
                              @RequestParam("phone") String phone,
                              @RequestParam(value = "yzmCode", defaultValue = "") String yzmCode,
                              @RequestParam("userPwd") String userPwd,
                              @RequestParam("email") String email,
                              @RequestParam("phoneCode")String phoneCode,
                              HttpServletRequest httpServletRequest) {
        return this.iUserService.reg(yzmCode, agentCode, phone, userPwd, email,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) {
        return this.iUserService.sendMailCode(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("发送失败,发生异常");
        }
    }