mall icon indicating copy to clipboard operation
mall copied to clipboard

关于refreshToken实现

Open gpqhl0071 opened this issue 3 years ago • 7 comments

看了下后端代码,有提供refreshToken ,刷新鉴权token的接口,但是在前端,没有找到实现的功能?

gpqhl0071 avatar Jul 02 '20 09:07 gpqhl0071

哈,看来不止我一个人有疑问。。那就是作者懒得在前端写了,但是这功能写的还是挺全的。

MarsZone avatar Aug 19 '20 12:08 MarsZone

嗯,等作者回复,花儿都谢了,很无语~~~~

gpqhl0071 avatar Aug 20 '20 00:08 gpqhl0071

刷新token逻辑是怎么样的,快过期的时候 然后 检测 刷新吗。

achunCoding avatar Sep 09 '20 00:09 achunCoding

例如1min过期,每59s就去请求下,获取新的token吧,前端自己定时轮训的

daidai21 avatar Sep 09 '20 16:09 daidai21

我这边前端,有自己的实现方式,当用户携带accressToken请求如果失效时,前端会携带refreshToken去获取新的accressToken。

gpqhl0071 avatar Sep 11 '20 00:09 gpqhl0071

可以参考这篇博客。刷新token 后端会返回刷新token和accessToken 当accessToken过期之后 携带刷新token去重新请求accessToken

achunCoding avatar Sep 18 '20 02:09 achunCoding

我很想知道,后台程序在哪里判断token是否过期,没看到这部分逻辑呀

LDTeemo avatar Nov 10 '20 09:11 LDTeemo