提交 64c06a3d 编写于 作者: shengzhang_'s avatar shengzhang_

StpUtil.logoutByTokenValue API的文档说明

上级 a6cf265e
package com.pj;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......@@ -8,10 +7,10 @@ import cn.dev33.satoken.SaTokenManager;
@SpringBootApplication
public class SaTokenDemoApplication {
public static void main(String[] args) {
SpringApplication.run(SaTokenDemoApplication.class, args);
SpringApplication.run(SaTokenDemoApplication.class, args);
System.out.println("\n启动成功:sa-token配置如下:" + SaTokenManager.getConfig());
}
}
\ No newline at end of file
......@@ -16,3 +16,10 @@
StpUtil.logoutByLoginId(10001);
```
#### StpUtil.logoutByTokenValue(String tokenValue);
你还可以让指定token的会话注销登录 (此方法直接删除了`token->uid`的映射关系,对方再次访问时提示:`token无效`,场景值为-2)
``` java
// 使账号id为10001的会话注销登录
StpUtil.logoutByTokenValue("xxxx-xxxx-xxxx-xxxx-xxxx");
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册