修成admin切分页面

This commit is contained in:
niyyzf 2024-07-02 18:32:02 +08:00
parent 09136a7806
commit 81e10fbf93
6 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,7 @@
"dotnetRunMessages": true,
"launchBrowser": false,
"launchUrl": "swagger",
"applicationUrl": "http://127.0.0.1:5000",
"applicationUrl": "http://192.168.0.13:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

View File

@ -1 +1 @@
NUXT_API_URL="http://127.0.0.1:5000"
NUXT_API_URL="http://192.168.0.13:5000"

View File

@ -35,8 +35,8 @@ const Menus =ref([
])
const filteredMenus=computed(()=>{
return Menus.value.filter(menu=>{
const role=mainLayoutStore.UserInfo.Role
return menu.label!=="账号列表"&&role!="admin"
const role=mainLayoutStore.UserInfo.role
return menu.label === "账号列表" ? role === "Admin" : true;
})
})
onMounted(() => {
@ -139,7 +139,7 @@ const logout=()=>{
'Authorization': 'Bearer ' + useCookie('token').value
},
baseURL: useRuntimeConfig().public.baseUrl
}).then(res=>{
}).then(()=>{
navigateTo("/SignIn")
})
}
@ -164,7 +164,7 @@ const logout=()=>{
<p>搜索</p>
</div>
<div class="menus">
<div v-for="menu in filteredMenus" v-tooltip="menu.label" class="menu-item" @click="navigateTo(menu.route)">
<div v-for="menu in filteredMenus" v-tooltip="menu.label" class="menu-item" @click="navigateTo(menu.route)" :key="menu.route">
<Icon :name="menu.icon"/>
<p>{{ menu.label }}</p>
</div>

View File

@ -143,7 +143,7 @@ watch(()=>mainLayoutStore.SelectServer.id,()=>{
<p>{{doc.userName}}</p>
</div>
<div class="action">
<button v-if="mainLayoutStore.UserInfo.Role==='admin'">删除</button>
<button v-if="mainLayoutStore.UserInfo.role==='Admin'">删除</button>
<button @click="selectWordChange(doc.wordId,true)">查看</button>
<button @click="selectWordChange(doc.wordId)">编辑</button>
</div>

View File

@ -11,7 +11,7 @@ const mainLayoutStore=useMainLayoutStore()
<template>
<div class="setting-layout">
<div class="setting-list">
<div @click="navigateTo('/settings/panelSettings')" v-if="mainLayoutStore.UserInfo.Role==='admin'">
<div @click="navigateTo('/settings/panelSettings')" v-if="mainLayoutStore.UserInfo.role==='Admin'">
<Icon name="Settings2"/>
<p>平台设置</p>
</div>

View File

@ -12,7 +12,7 @@ export type UserInfoType = {
avatar: string,
desc: string,
posts: string,
Role: string,
role: string,
}
export type UserInfoListType = {