Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
lls_program
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-09-03 22:08:45 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
530f1cf0ad7d160f4f4a75e66dbdb353b53a4c57
530f1cf0
1 parent
0b8ac319
fix(Profile): 修复菜单项初始化逻辑,根据用户身份显示不同菜单
根据用户是否为创建者来动态显示或隐藏'points'和'rewards'菜单项
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
src/pages/Profile/index.vue
src/pages/Profile/index.vue
View file @
530f1cf
...
...
@@ -98,7 +98,8 @@ const allMenuItems = [
}
];
const menuItems = shallowRef([]);
// 初始化菜单项,先显示除了'points'和'rewards'之外的菜单
const menuItems = shallowRef(allMenuItems.filter(item => !['points', 'rewards'].includes(item.id)));
const userInfo = ref({
nickName: '',
...
...
@@ -119,9 +120,11 @@ const initPageData = async () => {
avatarUrl: data?.user?.avatar_url || '',
is_creator: data?.user?.is_creator || false
}
// 根据用户身份更新菜单项
if (userInfo.value.is_creator) {
menuItems.value = allMenuItems;
} else {
// 非创建者保持原有的过滤逻辑
menuItems.value = allMenuItems.filter(item => !['points', 'rewards'].includes(item.id));
}
}
...
...
Please
register
or
login
to post a comment