mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-10-21 11:07:23 +08:00
refactor: 重构 SaTokenDao 接口,拆分存储与序列化操作
This commit is contained in:
@@ -7,6 +7,7 @@ import cn.dev33.satoken.stp.SaLoginConfig;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.dev33.satoken.util.SaFoxUtil;
|
||||
import cn.dev33.satoken.util.SaResult;
|
||||
import com.pj.model.SysUser;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -35,7 +36,13 @@ public class TestController {
|
||||
System.out.println("------------进来了 " + SaFoxUtil.formatDate(new Date()));
|
||||
// StpUtil.getLoginId();
|
||||
// StpUtil.getAnonTokenSession();
|
||||
StpUtil.setTokenValue("xxx");
|
||||
// StpUtil.setTokenValue("xxx");
|
||||
StpUtil.getSession().set("name", "zhang");
|
||||
StpUtil.getSession().set("age", 18);
|
||||
SysUser user = new SysUser(10001, "lisi", 22);
|
||||
StpUtil.getSession().set("user", user);
|
||||
StpUtil.getTokenSession().set("user", user);
|
||||
|
||||
// 返回
|
||||
return SaResult.data(null);
|
||||
}
|
||||
|
Reference in New Issue
Block a user