【权限替换为sa-token】token无效异常提醒修改

This commit is contained in:
JEECG
2025-10-16 11:40:53 +08:00
parent c7c31e0945
commit b24ac544c8
2 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ public class JeecgBootExceptionHandler {
@ResponseStatus(HttpStatus.UNAUTHORIZED)
public Result<?> handleNotLoginException(NotLoginException e){
log.error("Sa-Token未登录异常: {}", e.getMessage());
return new Result(401, "未登录,请先登录!");
return new Result(401, CommonConstant.TOKEN_IS_INVALID_MSG);
}
/**

View File

@ -144,7 +144,7 @@ public class SaTokenConfig implements WebMvcConfigurer {
SaHolder.getResponse()
.setStatus(401)
.setHeader("Content-Type", "application/json;charset=UTF-8");
return org.jeecg.common.system.util.JwtUtil.responseErrorJson(401, "未登录,请先登录!");
return org.jeecg.common.system.util.JwtUtil.responseErrorJson(401, CommonConstant.TOKEN_IS_INVALID_MSG);
})
// 前置函数在每次认证函数之前执行BeforeAuth 不受 includeList 与 excludeList 的限制,所有请求都会进入)
.setBeforeAuth(r -> {