fix: 优化用户信息获取,避免重复请求
性能优化: - User Store 添加防抖机制(5秒内不重复请求) - 修复 useShow 为 useDidShow(使用正确的 Taro 生命周期) - "我的"页面统一使用 userStore.fetchUserInfo() - 移除本地 userInfo ref 和 fetchUserProfile 函数 - 移除对 mainStore 和 getProfileAPI 的直接依赖 配置优化: - 添加 @/config 路径别名到 config/index.js 效果: - 从首页跳转到"我的"页面时,请求次数从 2 次减少到 1 次 - 页面间快速切换不会触发重复请求 - 统一状态管理,代码更简洁 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Showing
4 changed files
with
38 additions
and
36 deletions
-
Please register or login to post a comment