Home
Sign Up
Sign In
V2EX
›
问与答
小白求问, Vue 如何保存登录状态?
v2dev
·
Nov 6, 2018
· 2671 views
This topic created in 2947 days ago, the information mentioned may be changed or developed.
打算用 Vue 一款 App,不知道如何保存用户登录状态,使登录后的用户重新打开 App 后可以免登录,请问各位大佬有没有比较好的解决方案或 demo ?
Vue
登录
App
保存
2 replies
•
2018-11-07 11:42:34 +08:00
kslr
Nov 6, 2018 via Android
1
从状态管理下手,这个问题记得先搜索
lynan
Nov 7, 2018
2
登陆以后存用户信息到 store,如果用户刷新的话用 cookie 请求一遍返回用户信息的 api,再把用户信息存 store ;如果 cookie 失效就退出登录;清空 store 的用户信息
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
3101 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 29ms ·
UTC 05:28
·
PVG 13:28
·
LAX 21:28
·
JFK 00:28
♥ Do have faith in what you're doing.
❯