NotLoginException 增加新场景值 -6: token 已被冻结

This commit is contained in:
click33
2023-05-18 13:14:09 +08:00
parent 73e84decde
commit 46dd4be560
5 changed files with 41 additions and 25 deletions

View File

@@ -21,8 +21,7 @@ public class GlobalException {
// 全局异常拦截(拦截项目中的所有异常)
@ExceptionHandler
public AjaxJson handlerException(Exception e, HttpServletRequest request, HttpServletResponse response)
throws Exception {
public AjaxJson handlerException(Exception e, HttpServletRequest request, HttpServletResponse response) {
// 打印堆栈,以供调试
System.out.println("全局异常---------------");

View File

@@ -1,10 +1,9 @@
package com.pj.test;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.util.SaResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 登录测试
@@ -32,6 +31,13 @@ public class LoginController {
return SaResult.ok("是否登录:" + StpUtil.isLogin());
}
// 校验登录 ---- http://localhost:8081/acc/checkLogin
@RequestMapping("checkLogin")
public SaResult checkLogin() {
StpUtil.checkLogin();
return SaResult.ok();
}
// 查询 Token 信息 ---- http://localhost:8081/acc/tokenInfo
@RequestMapping("tokenInfo")
public SaResult tokenInfo() {