is-write-header 参数相关文档

This commit is contained in:
click33 2022-10-21 18:41:47 +08:00
parent f0186e99c4
commit 4c8be2abda
3 changed files with 3 additions and 0 deletions

View File

@ -37,6 +37,7 @@ StpUtil.login(10001, new SaLoginModel()
.setTimeout(60 * 60 * 24 * 7) // 指定此次登录token的有效期, 单位:秒 (如未指定,自动取全局配置的 timeout 值) .setTimeout(60 * 60 * 24 * 7) // 指定此次登录token的有效期, 单位:秒 (如未指定,自动取全局配置的 timeout 值)
.setToken("xxxx-xxxx-xxxx-xxxx") // 预定此次登录生成的Token .setToken("xxxx-xxxx-xxxx-xxxx") // 预定此次登录生成的Token
.setExtra("name", "zhangsan") // Token挂载的扩展参数 此方法只有在集成jwt插件时才会生效 .setExtra("name", "zhangsan") // Token挂载的扩展参数 此方法只有在集成jwt插件时才会生效
.setIsWriteHeader(false) // 是否在登录后将 Token 写入到响应头
); );
``` ```

View File

@ -76,6 +76,7 @@ StpUtil.login(10001, new SaLoginModel()
.setIsLastingCookie(true) // 是否为持久Cookie临时Cookie在浏览器关闭时会自动删除持久Cookie在重新打开后依然存在 .setIsLastingCookie(true) // 是否为持久Cookie临时Cookie在浏览器关闭时会自动删除持久Cookie在重新打开后依然存在
.setTimeout(60 * 60 * 24 * 7) // 指定此次登录token的有效期, 单位:秒 (如未指定,自动取全局配置的 timeout 值) .setTimeout(60 * 60 * 24 * 7) // 指定此次登录token的有效期, 单位:秒 (如未指定,自动取全局配置的 timeout 值)
.setToken("xxxx-xxxx-xxxx-xxxx") // 预定此次登录的生成的Token .setToken("xxxx-xxxx-xxxx-xxxx") // 预定此次登录的生成的Token
.setIsWriteHeader(false) // 是否在登录后将 Token 写入到响应头
); );
``` ```

View File

@ -125,6 +125,7 @@ public class SaTokenConfigure {
| isReadBody | Boolean | true | 是否尝试从 请求体 里读取 Token | | isReadBody | Boolean | true | 是否尝试从 请求体 里读取 Token |
| isReadHeader | Boolean | true | 是否尝试从 header 里读取 Token | | isReadHeader | Boolean | true | 是否尝试从 header 里读取 Token |
| isReadCookie | Boolean | true | 是否尝试从 cookie 里读取 Token此值为 false 后,`StpUtil.login(id)` 登录时也不会再往前端注入Cookie | | isReadCookie | Boolean | true | 是否尝试从 cookie 里读取 Token此值为 false 后,`StpUtil.login(id)` 登录时也不会再往前端注入Cookie |
| isWriteHeader | Boolean | false | 是否在登录后将 Token 写入到响应头 |
| tokenStyle | String | uuid | token风格 [参考自定义Token风格](/up/token-style) | | tokenStyle | String | uuid | token风格 [参考自定义Token风格](/up/token-style) |
| dataRefreshPeriod | int | 30 | 默认数据持久组件实现类中,每次清理过期数据间隔的时间 (单位: 秒) 默认值30秒设置为-1代表不启动定时清理 | | dataRefreshPeriod | int | 30 | 默认数据持久组件实现类中,每次清理过期数据间隔的时间 (单位: 秒) 默认值30秒设置为-1代表不启动定时清理 |
| tokenSessionCheckLogin | Boolean | true | 获取 `Token-Session` 时是否必须登录 如果配置为true会在每次获取 `Token-Session` 时校验是否登录),[详解](/use/config?id=配置项详解tokenSessionCheckLogin) | | tokenSessionCheckLogin | Boolean | true | 获取 `Token-Session` 时是否必须登录 如果配置为true会在每次获取 `Token-Session` 时校验是否登录),[详解](/use/config?id=配置项详解tokenSessionCheckLogin) |