Skip to content

Commit 3335df9

Browse files
authored
Update README.md
1 parent 7a01f1f commit 3335df9

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ $ php think jwt:make
2929
* `model` 用户模型
3030
* `refresh` Token过期抛异常code = 50001
3131
* `relogin` Token失效异常code = 50002
32+
* `automaticRenewal` [开启过期自动续签](过期自动续签)
3233

3334
以下两个异常都会抛一个HTTP异常 StatusCode = 401
3435
* `xiaodi\Exception\HasLoggedException`
@@ -135,3 +136,15 @@ return [
135136

136137
];
137138
```
139+
140+
## 过期自动续签
141+
`app/config/jwt.php`
142+
143+
`automaticRenewal => true`
144+
145+
系统检测到 Token 已过期, 会自动续期并返回以下 header 信息。
146+
147+
* Automatic-Renewal-Token
148+
* Automatic-Renewal-Token-RefreshAt
149+
150+
前端需要接收最新 Token,下次异步请求时,携带此 Token。

0 commit comments

Comments
 (0)