update
This commit is contained in:
@@ -25,7 +25,8 @@ http.interceptors.response.use(
|
|||||||
router.push("/")
|
router.push("/")
|
||||||
break
|
break
|
||||||
case 403: // 禁止访问
|
case 403: // 禁止访问
|
||||||
alert("禁止访问")
|
alert("权限不够,禁止访问")
|
||||||
|
router.push("/")
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
console.error("出现错误:", err.response.status, err.response.data)
|
console.error("出现错误:", err.response.status, err.response.data)
|
||||||
|
|||||||
@@ -1,15 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-flex class="container" :wrap="false">
|
<n-flex class="container" :wrap="false">
|
||||||
<n-flex vertical class="menu">
|
<n-flex vertical class="menu">
|
||||||
<n-button @click="$router.push({ name: 'home' })">返回</n-button>
|
<n-button secondary @click="$router.push({ name: 'home' })">
|
||||||
<n-button @click="$router.push({ name: 'tutorial' })">教程</n-button>
|
返回
|
||||||
|
</n-button>
|
||||||
|
<n-button
|
||||||
|
v-for="item in menu"
|
||||||
|
:type="$route.name === item.name ? 'primary' : 'default'"
|
||||||
|
@click="$router.push({ name: item.name })"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
</n-button>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
<n-flex class="content">
|
<n-flex class="content">
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup></script>
|
<script lang="ts" setup>
|
||||||
|
const menu = [
|
||||||
|
{ label: "教程", name: "tutorial" },
|
||||||
|
{ label: "用户", name: "user-manage" },
|
||||||
|
]
|
||||||
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.container {
|
.container {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|||||||
1
src/pages/UserManage.vue
Normal file
1
src/pages/UserManage.vue
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<template>用户管理页面</template>
|
||||||
@@ -17,6 +17,11 @@ const routes = [
|
|||||||
name: "tutorial",
|
name: "tutorial",
|
||||||
component: () => import("./pages/Markdown.vue"),
|
component: () => import("./pages/Markdown.vue"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "user-manage",
|
||||||
|
name: "user-manage",
|
||||||
|
component: () => import("./pages/UserManage.vue"),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user