瀏覽代碼

合并新疆代码

lyhzzz 10 月之前
父節點
當前提交
6015143a37

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

@@ -50,8 +50,8 @@ 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 = param.getCode();
+        //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);
         }

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

@@ -48,11 +48,13 @@ public class NoLoginController {
     public void  getLoginCode(HttpServletRequest request, HttpServletResponse response) throws IOException {
         response.setHeader("Cache-Control", "no-store, no-cache");
         response.setContentType("image/jpeg");
-        String id = request.getSession().getId();
+        String id ;
         try {
             LineCaptcha lineCaptcha = new LineCaptcha(200, 100);
             RandomGenerator mathGenerator = new RandomGenerator("1234567890",4);
             lineCaptcha.setGenerator(mathGenerator);
+            //id = request.getSession().getId();
+            id = lineCaptcha.getCode();
             redisUtil.set(String.format(RedisKeyUtil.loginAuthCode,id),lineCaptcha.getCode(),60*5);
             lineCaptcha.write(response.getOutputStream());
             response.getOutputStream().close();