fix: 🐛 修复修改头像后没有显示最新的头像

- 移除在 permission.ts 中的冗余用户信息检查

- 刷新页面确保获取最新的用户信息

- 更新 profile 页面中用户头像的显示逻辑

- 在头像上传成功后同步更新用户信息

#ICRONO
This commit is contained in:
zimo493
2025-08-07 12:26:13 +08:00
parent 0c2dff802a
commit 79521c4807
2 changed files with 9 additions and 8 deletions

View File

@@ -35,13 +35,11 @@ export function setupPermission() {
const permissionStore = usePermissionStore();
const userStore = useUserStore();
// 确保用户信息已加载
if (!userStore.userInfo.username) {
await userStore.getUserInfo();
}
// 确保动态路由已生成
if (!permissionStore.isDynamicRoutesGenerated) {
/** 先获取最新的用户信息 */
await userStore.getUserInfo();
const dynamicRoutes = await permissionStore.generateRoutes();
dynamicRoutes.forEach((route: RouteRecordRaw) => {
router.addRoute(route);