From 1248591c91616cfe5b91c3fa114689e5790bdebf Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Sun, 2 Feb 2025 21:11:00 +0800 Subject: [PATCH] pwd --- .../com/bonus/auth/controller/TokenController.java | 3 +-- .../com/bonus/auth/service/CustTokenService.java | 14 +++++++------- .../customer/controller/CustInfoController.java | 4 ++-- .../customer/service/impl/CustInfoServiceImpl.java | 4 ++-- .../resources/mapper/customer/CustInfoMapper.xml | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/bonus-cust-auth/src/main/java/com/bonus/auth/controller/TokenController.java b/bonus-cust-auth/src/main/java/com/bonus/auth/controller/TokenController.java index 66dafdab..8fef91b4 100644 --- a/bonus-cust-auth/src/main/java/com/bonus/auth/controller/TokenController.java +++ b/bonus-cust-auth/src/main/java/com/bonus/auth/controller/TokenController.java @@ -30,7 +30,6 @@ import com.bonus.config.SystemConfig; import com.bonus.system.api.RemoteConfigService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -99,7 +98,7 @@ public class TokenController { { concurrency = Long.parseLong(result.get("msg").toString()); } - Collection keys = redisService.keys(CustTokenService.CUST_LOGIN_TOKEN + "*"); + Collection keys = redisService.keys(CustTokenService.LOGIN_TOKEN + "*"); if (keys.size() >= concurrency){ return R.fail("当前系统用户并发数超过系统配置,请稍后再试"); } diff --git a/bonus-cust-auth/src/main/java/com/bonus/auth/service/CustTokenService.java b/bonus-cust-auth/src/main/java/com/bonus/auth/service/CustTokenService.java index 3bcdd6c0..840f9b2f 100644 --- a/bonus-cust-auth/src/main/java/com/bonus/auth/service/CustTokenService.java +++ b/bonus-cust-auth/src/main/java/com/bonus/auth/service/CustTokenService.java @@ -53,9 +53,9 @@ public class CustTokenService { public final static String IS_LOGIN = "isLogin"; - public final static String CUST_LOGIN_TOKEN = "cust_login_tokens:"; + public final static String LOGIN_TOKEN = "login_tokens:"; - private final static String CUST_LOGIN_USER_KEY = "cust_login_users:"; + private final static String LOGIN_USER_KEY = "login_users:"; private final static Long MILLIS_MINUTE_TEN = 120L * MILLIS_MINUTE; @@ -90,12 +90,12 @@ public class CustTokenService { rspMap.put(IS_LOGIN, isLogin(String.valueOf(custId))); long tokenTime = getTokenTime(); //对token进行存储 - redisService.setCacheObject(CUST_LOGIN_USER_KEY + custId, token, tokenTime, TimeUnit.MINUTES); + redisService.setCacheObject(LOGIN_USER_KEY + custId, token, tokenTime, TimeUnit.MINUTES); return rspMap; } public boolean isLogin(String userId) { - String existingTokenKey = redisService.getCacheObject(CUST_LOGIN_USER_KEY + userId); + String existingTokenKey = redisService.getCacheObject(LOGIN_USER_KEY + userId); return existingTokenKey != null; } @@ -107,10 +107,10 @@ public class CustTokenService { * 删除已有的token */ public void delExistingToken(Long userId) { - String existingTokenKey = redisService.getCacheObject(CUST_LOGIN_USER_KEY + userId); + String existingTokenKey = redisService.getCacheObject(LOGIN_USER_KEY + userId); if (existingTokenKey != null) { redisService.deleteObject(getTokenKey(existingTokenKey)); - redisService.deleteObject(CUST_LOGIN_USER_KEY + userId); + redisService.deleteObject(LOGIN_USER_KEY + userId); } } @@ -200,7 +200,7 @@ public class CustTokenService { } private String getTokenKey(String token) { - return CUST_LOGIN_TOKEN + token; + return LOGIN_TOKEN + token; } private Long getTokenTime(){ diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/net/xnzn/core/customer/controller/CustInfoController.java b/bonus-modules/bonus-smart-canteen/src/main/java/net/xnzn/core/customer/controller/CustInfoController.java index 01482457..f71fc66f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/net/xnzn/core/customer/controller/CustInfoController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/net/xnzn/core/customer/controller/CustInfoController.java @@ -33,8 +33,8 @@ public class CustInfoController extends BaseController { @ApiOperation("忘记密码") @PostMapping({"/forget/password"}) public AjaxResult forgetPassword(@Validated @RequestBody CustForgetPasswordDTO content) { - content.setMobile(AesEncryptUtil.aesDecode(content.getMobile())); - content.setNewPassword(AesEncryptUtil.aesDecode(content.getNewPassword())); +// content.setMobile(AesEncryptUtil.aesDecode(content.getMobile())); +// content.setNewPassword(AesEncryptUtil.aesDecode(content.getNewPassword())); this.custInfoService.custForgetPassword(content); return success(); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/net/xnzn/core/customer/service/impl/CustInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/net/xnzn/core/customer/service/impl/CustInfoServiceImpl.java index ff8bb5fc..efeee768 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/net/xnzn/core/customer/service/impl/CustInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/net/xnzn/core/customer/service/impl/CustInfoServiceImpl.java @@ -65,8 +65,8 @@ public class CustInfoServiceImpl implements CustInfoService { } public void custForgetPassword(CustForgetPasswordDTO content) { - content.setMobile(AesEncryptUtil.aesDecode(content.getMobile())); - content.setNewPassword(AesEncryptUtil.aesDecode(content.getNewPassword())); +// content.setMobile(AesEncryptUtil.aesDecode(content.getMobile())); +// content.setNewPassword(AesEncryptUtil.aesDecode(content.getNewPassword())); SmsCodeVerifyDTO smsCodeVerifyDTO = new SmsCodeVerifyDTO(); smsCodeVerifyDTO.setTelephoneNumber(content.getMobile()); smsCodeVerifyDTO.setCode(content.getCode()); diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/customer/CustInfoMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/customer/CustInfoMapper.xml index 5c21d4f0..615f1936 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/customer/CustInfoMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/customer/CustInfoMapper.xml @@ -6,7 +6,7 @@ select cust_id, cust_name, cust_num, cust_photo_url, mobile, pwd from cust_info - cust_status = 1 + cust_state = 1 and cust_id = #{custId}