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: []
|
||||
},
|
||||
{
|
||||
path: "/:pathMatch(.*)*",
|
||||
path: "/:catchAll(.*)",
|
||||
name: "404",
|
||||
component: () => import("/$/base/pages/error/404.vue")
|
||||
}
|
||||
];
|
||||
@ -174,9 +175,8 @@ router.beforeEach(async (to, from, next) => {
|
||||
if (!route?.components) {
|
||||
next(user.token ? "/404" : "/login");
|
||||
} else {
|
||||
// 注册后重定向
|
||||
if (!isReg) {
|
||||
next({ ...to, ...route });
|
||||
next(to.fullPath);
|
||||
} else {
|
||||
// 登录成功
|
||||
if (user.token) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="app-process">
|
||||
<ul class="app-process__op">
|
||||
<li class="item" @click="router.back">
|
||||
<li class="item" @click="toBack">
|
||||
<i class="cl-iconfont cl-icon-back"></i>
|
||||
</li>
|
||||
<li class="item" @click="toRefresh">
|
||||
@ -55,6 +55,11 @@ function toHome() {
|
||||
router.push("/");
|
||||
}
|
||||
|
||||
// 返回上一页
|
||||
function toBack() {
|
||||
router.back();
|
||||
}
|
||||
|
||||
// 跳转
|
||||
function toPath() {
|
||||
const d = process.list.find((e) => e.active);
|
||||
|
Loading…
Reference in New Issue
Block a user