StringUtils替换

This commit is contained in:
2025-07-30 13:43:20 +08:00
parent 2a7b8664f8
commit 05412b2abf
9 changed files with 26 additions and 22 deletions

View File

@@ -17,6 +17,7 @@ import com.ycwl.basic.model.pc.scenic.entity.ScenicAccountEntity;
import com.ycwl.basic.utils.JwtTokenUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
@@ -78,7 +79,7 @@ public class AuthInterceptor implements HandlerInterceptor {
JwtInfo jwtInfo;
try {
jwtInfo = JwtTokenUtil.parsingToken(token);
if (StringUtils.equals(jwtInfo.getRoleId(), MERCHANT.type)) {
if (Strings.CS.equals(jwtInfo.getRoleId(), MERCHANT.type)) {
Long merchantId = jwtInfo.getUserId();
ScenicAccountEntity account = scenicAccountMapper.findAccountById(merchantId.toString());
LocalDateTime expireTime = jwtInfo.getExpireTime();
@@ -86,7 +87,7 @@ public class AuthInterceptor implements HandlerInterceptor {
throw new TokenExpireException("token过期");
}
}
if (StringUtils.equals(jwtInfo.getRoleId(), ADMIN.type)) {
if (Strings.CS.equals(jwtInfo.getRoleId(), ADMIN.type)) {
Long adminId = jwtInfo.getUserId();
LoginEntity account = adminUserMapper.getById(adminId);
LocalDateTime expireTime = jwtInfo.getExpireTime();