fix(auth): 记录未登录异常的详细日志
- 在处理未登录异常的方法中添加错误日志记录 - 记录异常类型以方便问题定位 - 记录异常信息帮助诊断具体原因 - 保持返回 401 状态码和提示信息不变
This commit is contained in:
parent
cd9692efae
commit
4daa6983be
|
|
@ -68,6 +68,8 @@ public class GlobalRestControllerAdvice {
|
|||
@ExceptionHandler(NotLoginException.class)
|
||||
@ResponseStatus(HttpStatus.UNAUTHORIZED) // 返回 401 状态码
|
||||
public String handleNotLoginException(NotLoginException e) {
|
||||
log.error("未登录异常类型: {}", e.getType());
|
||||
log.error("未登录异常信息: {}", e.getMessage());
|
||||
return "请重新登录";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue