feat(登录): 添加用户信息缓存到localStorage
在登录成功后,将用户信息缓存到localStorage以便后续使用
Showing
1 changed file
with
2 additions
and
0 deletions
| ... | @@ -285,6 +285,8 @@ const handleSubmit = async () => { | ... | @@ -285,6 +285,8 @@ const handleSubmit = async () => { |
| 285 | if (user_id && HTTP_USER_TOKEN) { | 285 | if (user_id && HTTP_USER_TOKEN) { |
| 286 | // 设置认证请求头 | 286 | // 设置认证请求头 |
| 287 | setAuthHeaders(user_id, HTTP_USER_TOKEN); | 287 | setAuthHeaders(user_id, HTTP_USER_TOKEN); |
| 288 | + // 缓存user_info | ||
| 289 | + localStorage.setItem('user_info', JSON.stringify(response?.data?.user_info || {})); | ||
| 288 | } | 290 | } |
| 289 | } | 291 | } |
| 290 | 292 | ... | ... |
-
Please register or login to post a comment