mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
解决路由问题
This commit is contained in:
parent
c8582a7547
commit
1ab8562123
@ -18,7 +18,8 @@ const routes: RouteRecordRaw[] = [
|
|||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/:pathMatch(.*)*",
|
path: "/:catchAll(.*)",
|
||||||
|
name: "404",
|
||||||
component: () => import("/$/base/pages/error/404.vue")
|
component: () => import("/$/base/pages/error/404.vue")
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@ -174,9 +175,8 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
if (!route?.components) {
|
if (!route?.components) {
|
||||||
next(user.token ? "/404" : "/login");
|
next(user.token ? "/404" : "/login");
|
||||||
} else {
|
} else {
|
||||||
// 注册后重定向
|
|
||||||
if (!isReg) {
|
if (!isReg) {
|
||||||
next({ ...to, ...route });
|
next(to.fullPath);
|
||||||
} else {
|
} else {
|
||||||
// 登录成功
|
// 登录成功
|
||||||
if (user.token) {
|
if (user.token) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-process">
|
<div class="app-process">
|
||||||
<ul class="app-process__op">
|
<ul class="app-process__op">
|
||||||
<li class="item" @click="router.back">
|
<li class="item" @click="toBack">
|
||||||
<i class="cl-iconfont cl-icon-back"></i>
|
<i class="cl-iconfont cl-icon-back"></i>
|
||||||
</li>
|
</li>
|
||||||
<li class="item" @click="toRefresh">
|
<li class="item" @click="toRefresh">
|
||||||
@ -55,6 +55,11 @@ function toHome() {
|
|||||||
router.push("/");
|
router.push("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 返回上一页
|
||||||
|
function toBack() {
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
|
||||||
// 跳转
|
// 跳转
|
||||||
function toPath() {
|
function toPath() {
|
||||||
const d = process.list.find((e) => e.active);
|
const d = process.list.find((e) => e.active);
|
||||||
|
Loading…
Reference in New Issue
Block a user