解决路由问题

This commit is contained in:
神仙都没用 2023-12-15 16:33:53 +08:00
parent c8582a7547
commit 1ab8562123
2 changed files with 9 additions and 4 deletions

View File

@ -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) {

View File

@ -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);