lyhzzz 1 tahun lalu
induk
melakukan
8c1b850f38

+ 3 - 2
src/main/java/com/fdkankan/fusion/controller/LoginController.java

@@ -50,14 +50,15 @@ public class LoginController extends BaseController{
                 || StringUtils.isBlank(param.getCode()) || StringUtils.isBlank(param.getDeptId())){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        String id = request.getSession().getId();
+        //String id = request.getSession().getId();
+        String id = param.getCode();
         if(!redisUtil.hasKey(String.format(RedisKeyUtil.loginAuthCode,id))){
             throw new BusinessException(ResultCode.LOGIN_AUTH_NOT_EXIST);
         }
         if(!redisUtil.get(String.format(RedisKeyUtil.loginAuthCode,id)).equals(param.getCode())){
             throw new BusinessException(ResultCode.LOGIN_AUTH_NOT_EXIST);
         }
-        redisUtil.del(String.format(RedisKeyUtil.loginAuthCode,param.getCode()));
+        redisUtil.del(String.format(RedisKeyUtil.loginAuthCode,id));
         TmUser tmUser = tmUserService.getByUserName(param.getPhoneNum());
         if(tmUser == null){
             throw new BusinessException(ResultCode.PASSWORD_ERROR);

+ 1 - 1
src/main/java/com/fdkankan/fusion/controller/NoLoginController.java

@@ -39,7 +39,7 @@ public class NoLoginController {
         String id = request.getSession().getId();
         try {
             LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(200, 100,4,60);
-            redisUtil.set(String.format(RedisKeyUtil.loginAuthCode,id),lineCaptcha.getCode(),30);
+            redisUtil.set(String.format(RedisKeyUtil.loginAuthCode,lineCaptcha.getCode()),lineCaptcha.getCode(),30);
             lineCaptcha.write(response.getOutputStream());
             response.getOutputStream().close();
         } catch (Exception e){