StpUtil.logoutByTokenValue API的文档说明

This commit is contained in:
shengzhang
2021-03-25 22:20:45 +08:00
parent a6cf265e4d
commit 64c06a3daf
2 changed files with 10 additions and 4 deletions

View File

@@ -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());
}
}

View 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");
```