mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-10-20 18:47:25 +08:00
StpUtil.logoutByTokenValue API的文档说明
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -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");
|
||||
```
|
||||
|
Reference in New Issue
Block a user