fix: 🐛 修复修改头像后没有显示最新的头像
- 移除在 permission.ts 中的冗余用户信息检查 - 刷新页面确保获取最新的用户信息 - 更新 profile 页面中用户头像的显示逻辑 - 在头像上传成功后同步更新用户信息 #ICRONO
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user