Skip to content

Commit

Permalink
Fix. 修复token刷新后丢失过期时间的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
RavelloH committed Jan 24, 2025
1 parent 875f6aa commit da7e6b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ const token = {
.then((response) => response.json())
.then((data) => {
if (data.token) {
cookie.setItem('usertoken', data.token, data.info.exp - data.info.iat);
cookie.setItem('usertoken', data.token, Number(token.read("exp") - token.read("iat")));
console.log(data.info.exp - data.info.iat)
message.success('已使用当前Token重新登陆');
resolve(data.token);
} else {
Expand Down

0 comments on commit da7e6b3

Please sign in to comment.