chore: remove console && update components
This commit is contained in:
parent
67545252fe
commit
8fe6d5c827
@ -5,18 +5,18 @@ const router: RouteRecordRaw[] = [
|
||||
{
|
||||
path: '/develop',
|
||||
component: () => import('/admin/layout/index.vue'),
|
||||
meta: { title: '开发工具', icon: 'wrench-screwdriver', hidden: false },
|
||||
meta: { title: '开发工具', icon: 'wrench-screwdriver' },
|
||||
children: [
|
||||
{
|
||||
path: 'modules',
|
||||
name: 'modules',
|
||||
meta: { title: '模块管理', icon: 'home', hidden: false },
|
||||
meta: { title: '模块管理', icon: 'queue-list' },
|
||||
component: () => import('./module/index.vue'),
|
||||
},
|
||||
{
|
||||
path: 'schemas',
|
||||
name: 'schemas',
|
||||
meta: { title: 'Schemas', icon: 'home', hidden: false },
|
||||
meta: { title: 'Schemas', icon: 'list-bullet' },
|
||||
component: () => import('./schema/index.vue'),
|
||||
},
|
||||
{
|
||||
|
@ -18,7 +18,6 @@ const next = () => {
|
||||
active.value = 2
|
||||
}
|
||||
}
|
||||
console.log(123)
|
||||
const prev = () => {
|
||||
if (active.value-- === 1) {
|
||||
active.value = 1
|
||||
|
@ -9,13 +9,13 @@ const router: RouteRecordRaw[] = [
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'users',
|
||||
name: 'user-account',
|
||||
meta: { title: '账号管理', icon: 'home' },
|
||||
component: () => import('./user/index.vue'),
|
||||
},
|
||||
{
|
||||
path: 'center',
|
||||
name: 'center',
|
||||
name: 'user-center',
|
||||
meta: { title: '个人中心', icon: 'home' },
|
||||
component: () => import('./user/center.vue'),
|
||||
},
|
||||
|
@ -23,23 +23,27 @@ watch(router.currentRoute, (newValue, oldValue) => {
|
||||
if (newValue.meta.active_menu) {
|
||||
appStore.setActiveMenu(newValue.meta.active_menu)
|
||||
}
|
||||
setActiveMenu(newValue)
|
||||
getBreadcrumbs(newValue)
|
||||
})
|
||||
|
||||
// get init breadcrumb
|
||||
onMounted(() => {
|
||||
if (router.currentRoute.value.path !== '/') {
|
||||
// 如果是内页,并且设置激活菜单
|
||||
if (router.currentRoute.value.meta.active_menu) {
|
||||
appStore.setActiveMenu(router.currentRoute.value.meta.active_menu)
|
||||
} else {
|
||||
appStore.setActiveMenu(router.currentRoute.value.path)
|
||||
}
|
||||
}
|
||||
|
||||
setActiveMenu(router.currentRoute.value)
|
||||
getBreadcrumbs(router.currentRoute.value)
|
||||
})
|
||||
|
||||
const setActiveMenu = route => {
|
||||
if (route.path !== '/') {
|
||||
// 如果是内页,并且设置激活菜单
|
||||
if (route.meta.active_menu) {
|
||||
appStore.setActiveMenu(route.meta.active_menu)
|
||||
} else {
|
||||
appStore.setActiveMenu(route.path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get breadcrums
|
||||
function getBreadcrumbs(newRoute: RouteLocationNormalizedLoaded) {
|
||||
breadcrumbs.value = []
|
||||
|
@ -63,7 +63,6 @@ const uploaded = (blobInfo, progress) =>
|
||||
params.append('image', blobInfo.blob())
|
||||
Http.post(env('VITE_BASE_URL') + 'upload/image', params)
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
if (res.data.code === 10000) {
|
||||
resolve(res.data.data.path)
|
||||
} else {
|
||||
|
@ -7,9 +7,7 @@
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu class="w-28">
|
||||
<el-dropdown-item>
|
||||
<Icon name="user"/> <router-link to="/users/center"> 个人信息</router-link>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item> <Icon name="user" /> <router-link :to="{ name: 'user-center' }"> 个人信息</router-link> </el-dropdown-item>
|
||||
<el-dropdown-item divided @click="logout">
|
||||
<Icon name="power" className="mr-1 w-4 h-4" />
|
||||
退 出
|
||||
|
@ -47,7 +47,7 @@ const guard = (router: Router) => {
|
||||
redirect: '/404',
|
||||
})
|
||||
}
|
||||
next({ ...to, replace: true });
|
||||
next({ ...to, replace: true })
|
||||
} catch (e) {
|
||||
removeAuthToken()
|
||||
next({ path: `${WhiteListPage.LOGIN_PATH}?redirect=/${to.path}` })
|
||||
@ -58,7 +58,6 @@ const guard = (router: Router) => {
|
||||
} else {
|
||||
// 如果不在白名单
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
console.log(123)
|
||||
next()
|
||||
} else {
|
||||
next({ path: WhiteListPage.LOGIN_PATH })
|
||||
|
Loading…
x
Reference in New Issue
Block a user