()
| 489 | * 获取本地存储的用户信息 |
| 490 | */ |
| 491 | export function getStoredUser(): UserResponse | null { |
| 492 | if (typeof window === 'undefined') return null; |
| 493 | const userStr = localStorage.getItem('user'); |
| 494 | return userStr ? JSON.parse(userStr) : null; |
| 495 | } |
| 496 | |
| 497 | /** |
| 498 | * 获取本地存储的 token |