mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-05-09 08:46:23 +08:00
优化登录拦截功能
This commit is contained in:
@@ -25,9 +25,7 @@ public class StpInException {
|
||||
@ExceptionHandler(NotLoginException.class)
|
||||
@ResponseBody
|
||||
public AjaxResult<Object> handleNotLoginException(NotLoginException e){
|
||||
String msg = e.getMessage().split(":")[0];
|
||||
msg = msg.replaceFirst("Token", "您");
|
||||
msg = msg.trim().equals("") ? HttpEnum.TOKEN_INVALID.getMsg() : msg;
|
||||
String msg = e.getMessage().startsWith("Token无效") ? "尚未登录,请先登录!" : e.getMessage();
|
||||
return AjaxResult.failed(HttpEnum.TOKEN_INVALID.getCode(), msg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user