소스 검색

商家平台端注册,登录,忘记密码

qrs 1 개월 전
부모
커밋
698e968eb8

+ 4 - 6
alien-store-platform/src/main/java/shop/alien/storeplatform/controller/StorePlatformLoginController.java

@@ -12,7 +12,6 @@ import shop.alien.entity.store.vo.StoreUserVo;
 import shop.alien.mapper.StoreUserMapper;
 import shop.alien.storeplatform.service.StorePlatformLoginervice;
 
-import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.io.IOException;
@@ -79,7 +78,7 @@ public class StorePlatformLoginController {
             String password,
             String code,
             String captcha,
-            HttpServletRequest request) {
+            HttpSession session) {
         log.info("StorePlatformLoginController.login?phone={}&password={}&isPassword={}&code={}&captcha={}", phone, password, isPassword, code, captcha);
         if (!isPassword) {
             // 2025-11-04 验证码-商户端登录
@@ -91,7 +90,6 @@ public class StorePlatformLoginController {
                 return R.fail("验证码错误");
             }
         } else {
-            HttpSession session = request.getSession();
 //            String cacheCode = baseRedisService.getString("store_platform_captcha_" + phone);
             String cacheCode = (String) session.getAttribute("captcha");
             if (null == cacheCode) {
@@ -162,9 +160,9 @@ public class StorePlatformLoginController {
     @ApiOperation("生成验证码")
     @ApiOperationSupport(order = 5)
     @GetMapping("/generateCaptcha")
-    public void generateCaptcha(HttpServletResponse response, HttpServletRequest request) throws IOException {
-//        log.info("StorePlatformLoginController.generateCaptcha?session={}", session.toString());
-        storePlatformLoginService.generateCaptcha(response, request);
+    public void generateCaptcha(HttpServletResponse response, HttpSession session) throws IOException {
+        log.info("StorePlatformLoginController.generateCaptcha?session={}", session.toString());
+        storePlatformLoginService.generateCaptcha(response, session);
     }
 
 }

+ 1 - 2
alien-store-platform/src/main/java/shop/alien/storeplatform/service/StorePlatformLoginervice.java

@@ -4,7 +4,6 @@ import shop.alien.entity.result.R;
 import shop.alien.entity.store.StoreUser;
 import shop.alien.entity.store.vo.StoreUserVo;
 
-import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.io.IOException;
@@ -29,6 +28,6 @@ public interface StorePlatformLoginervice {
      */
     R<String> forgetOrModifyPassword(String phone, String newPhone, String oldPassword, String newPassword,String confirmNewPassword,String verificationCode,  Integer type);
 
-    void generateCaptcha(HttpServletResponse response, HttpServletRequest request) throws IOException;
+    void generateCaptcha(HttpServletResponse response, HttpSession session) throws IOException;
 
 }

+ 1 - 3
alien-store-platform/src/main/java/shop/alien/storeplatform/service/impl/StorePlatformLoginServiceImpl.java

@@ -24,7 +24,6 @@ import shop.alien.storeplatform.service.StorePlatformLoginervice;
 import shop.alien.util.common.DateUtils;
 import shop.alien.util.common.JwtUtil;
 
-import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.io.IOException;
@@ -191,9 +190,8 @@ public class StorePlatformLoginServiceImpl extends ServiceImpl<StoreUserMapper,
     }
 
     @Override
-    public void generateCaptcha(HttpServletResponse response, HttpServletRequest request) throws IOException {
+    public void generateCaptcha(HttpServletResponse response, HttpSession session) throws IOException {
         try {
-            HttpSession session = request.getSession();
             LineCaptcha captcha = CaptchaUtil.createLineCaptcha(200, 100, 4, 100);
             session.setAttribute("captcha", captcha.getCode());
             response.setContentType("image/png");