jiangping
2024-07-16 1be9f9fdb13f7c5cdcf29494cb72ced35cd7af10
server/service/src/main/java/com/doumee/config/Jwt/WebMvcConfig.java
@@ -13,6 +13,7 @@
import io.jsonwebtoken.JwtException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
@@ -40,6 +41,12 @@
    @Autowired
    private RedisTemplate<String,Object> redisTemplate;
    /**
     * 是否开发者
     */
    @Value("${debug_model}")
    private Boolean isDebug;
    /**
     * 添加拦截器
@@ -121,6 +128,9 @@
    public Boolean checkPersonnelLogin(HttpServletRequest request, HttpServletResponse response){
        String token = request.getHeader(JwtTokenUtil.HEADER_KEY);
        try {
            if(isDebug){
                return  true;
            }
            //判断Token是否超时
            boolean expiration = JwtTokenUtil.isTokenExpired(token);
            if (expiration) {