chore: remove console && update components
This commit is contained in:
@@ -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" />
|
||||
退 出
|
||||
|
@@ -43,11 +43,11 @@ const guard = (router: Router) => {
|
||||
})
|
||||
// 在动态路由之后挂载匹配 404 路由
|
||||
router.addRoute({
|
||||
path: '/:pathMatch(.*)*',
|
||||
redirect: '/404',
|
||||
path: '/:pathMatch(.*)*',
|
||||
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 })
|
||||
|
Reference in New Issue
Block a user