You've already forked FrameTour-BE
StringUtils替换
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user