Compare commits

..

No commits in common. "b2cd675799f3ad9f5ea944e3595d4dc0cda61075" and "242d7e9bb6b4c01d5b0d633132f3113fd4de96ac" have entirely different histories.

2 changed files with 8 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import com.syjiaer.clinic.server.common.util.ParmsUtil;
import com.syjiaer.clinic.server.common.vo.Result;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.JwtException;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.security.Keys;
import jakarta.servlet.http.HttpServletRequest;
@ -50,9 +51,9 @@ public class MvcInterceptor implements HandlerInterceptor {
return true; // 如果方法上有 @NoAuthCheck 注解则跳过检查
}
}
return checkManager(response);
return checkManage(response);
}
private Boolean checkManager(HttpServletResponse response) throws IOException {
private Boolean checkManage(HttpServletResponse response) throws IOException {
Map<String, String> headers =headersUtil.getMap();
String token = headers.get("authorization");
if (token == null || token.isEmpty()) {
@ -65,6 +66,9 @@ public class MvcInterceptor implements HandlerInterceptor {
.verifyWith(Keys.hmacShaKeyFor(jwtSecret.getBytes()))
.build()
.parseSignedClaims(token);
} catch (JwtException e) {
setErrorResult(response,"登录令牌已失效,请重新登陆",301);
return false;
} catch (Exception e) {
setErrorResult(response,"登录令牌已失效,请重新登陆",301);
return false;

View File

@ -70,10 +70,10 @@ public class SocialDirectoryService extends BaseService {
queryWrapper.in("code", code_list);
socialDirectoryMapper.delete(queryWrapper);
}
return insertAll(version_name, type, tab_list);
return insertSocialDirectorys(version_name, type, tab_list);
}
private String insertAll(String version_name, int type, List<String[]> tab_list) {
private String insertSocialDirectorys(String version_name, int type, List<String[]> tab_list) {
Map<String, String> title_map = dictoryUtil.getTitleMap(String.valueOf(type));
List<SocialDirectory> list = new ArrayList<>();
HashMap<String, SocialDirectory> tmp_map = new HashMap<>();