修成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, "dotnetRunMessages": true,
"launchBrowser": false, "launchBrowser": false,
"launchUrl": "swagger", "launchUrl": "swagger",
"applicationUrl": "http://127.0.0.1:5000", "applicationUrl": "http://192.168.0.13:5000",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "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(()=>{ const filteredMenus=computed(()=>{
return Menus.value.filter(menu=>{ return Menus.value.filter(menu=>{
const role=mainLayoutStore.UserInfo.Role const role=mainLayoutStore.UserInfo.role
return menu.label!=="账号列表"&&role!="admin" return menu.label === "账号列表" ? role === "Admin" : true;
}) })
}) })
onMounted(() => { onMounted(() => {
@ -139,7 +139,7 @@ const logout=()=>{
'Authorization': 'Bearer ' + useCookie('token').value 'Authorization': 'Bearer ' + useCookie('token').value
}, },
baseURL: useRuntimeConfig().public.baseUrl baseURL: useRuntimeConfig().public.baseUrl
}).then(res=>{ }).then(()=>{
navigateTo("/SignIn") navigateTo("/SignIn")
}) })
} }
@ -164,7 +164,7 @@ const logout=()=>{
<p>搜索</p> <p>搜索</p>
</div> </div>
<div class="menus"> <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"/> <Icon :name="menu.icon"/>
<p>{{ menu.label }}</p> <p>{{ menu.label }}</p>
</div> </div>

View File

@ -143,7 +143,7 @@ watch(()=>mainLayoutStore.SelectServer.id,()=>{
<p>{{doc.userName}}</p> <p>{{doc.userName}}</p>
</div> </div>
<div class="action"> <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,true)">查看</button>
<button @click="selectWordChange(doc.wordId)">编辑</button> <button @click="selectWordChange(doc.wordId)">编辑</button>
</div> </div>

View File

@ -11,7 +11,7 @@ const mainLayoutStore=useMainLayoutStore()
<template> <template>
<div class="setting-layout"> <div class="setting-layout">
<div class="setting-list"> <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"/> <Icon name="Settings2"/>
<p>平台设置</p> <p>平台设置</p>
</div> </div>

View File

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