204 Star 2.2K Fork 1.2K

smallchill / Saber

 / 详情

refreshToken函数存在问题

Backlog
Opened this issue  
2021-03-02 14:07

refreshToken() {
this.refreshTime = setInterval(() => {
const token = getStore({
name: "token",
debug: true
});
const date = calcDate(token.datetime, new Date().getTime());
if (validatenull(date)) return;
if (!(date.seconds >= this.website.tokenTime) && !this.refreshLock) {
this.refreshLock = true;
this.$store
.dispatch("RefreshToken")
.then(() => {
this.refreshLock = false;
})
.catch(() => {
this.refreshLock = false;
});
}
}, 10000);
}
判断条件错误:
date.seconds是token存在的时长
this.website.tokenTime是token有效期
应该是当(date.seconds >= this.website.tokenTime) && !this.refreshLock时刷新token才对

Comments (1)

laurie created任务
laurie set related repository to smallchill/Saber
Expand operation logs

必须登录来感谢你。

说实话,SpringBlade开源挺好的,我受益良多。但居然犯了这么低级得错误,而且影响非常大得错误。请问是否经过测试?

我打开注释后,每次登录10秒钟就登出,原来就是这个原因。

希望开源团队还是对免费版本进行基本的必要测试吧,别把自己招牌毁了。

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(2)
JavaScript
1
https://git.oschina.net/smallc/Saber.git
git@git.oschina.net:smallc/Saber.git
smallc
Saber
Saber

Search

101014 b92fc32e 1850385 101014 af024cb7 1850385