页面本地存储的token应该带有规范的key名 #45

Open
opened 2024-12-25 11:50:18 +08:00 by liangyuanpeng · 4 comments

目前直接使用的是 "token", 应该使用对应的key, 否则会将其他不相关页面的token拿来使用,导致异常.

规则可以是这样: "smt:token:{page}", eg: smt:token:tab , smt:token:simplepage

image

目前直接使用的是 "token", 应该使用对应的key, 否则会将其他不相关页面的token拿来使用,导致异常. 规则可以是这样: "smt:token:{page}", eg: smt:token:tab , smt:token:simplepage ![image](/attachments/6cf3e83c-d9f9-4f12-8982-ced88b4eb15a)
138 KiB
jeff was assigned by liangyuanpeng 2024-12-25 11:50:18 +08:00
Author
Owner

很快将会有一个新的 login API, 会返回token的过期时间, 前端在使用前需要检查下是否过期,如果过期了需要获取新的token.

很快将会有一个新的 login API, 会返回token的过期时间, 前端在使用前需要检查下是否过期,如果过期了需要获取新的token.
liangyuanpeng added the
bug
label 2024-12-25 12:10:10 +08:00
jeff added the
done-waiting-confirmed
label 2024-12-30 00:26:03 +08:00
Owner

已经更换了 key 了

已经更换了 key 了
Author
Owner

@ginfone 如果不是按照issue实现的记得说一下,token规则替换为了 token-{pagetype}, 而不是issue中描述的 smt:token:{page} , 能够满足需求,因此关闭issue

@ginfone 如果不是按照issue实现的记得说一下,token规则替换为了 token-{pagetype}, 而不是issue中描述的 smt:token:{page} , 能够满足需求,因此关闭issue
Author
Owner

重新打开,需要确认一点

https://smartoilets.net/tab/admin/settings/twsc/4A/malehttps://smartoilets.net/tab/home/twsc/4A/male

前端本地存储的token是不一样的,虽然都是tab页面,但admin端是用户手动登录的,而home端是匿名页面。

重新打开,需要确认一点 https://smartoilets.net/tab/admin/settings/twsc/4A/male 和 https://smartoilets.net/tab/home/twsc/4A/male 前端本地存储的token是不一样的,虽然都是tab页面,但admin端是用户手动登录的,而home端是匿名页面。
liangyuanpeng removed the
done-waiting-confirmed
label 2025-01-06 10:32:10 +08:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: smartoilets-front/projects#45
No description provided.