修改路由路径,以及不存在的页面跳转到主页面
This commit is contained in:
parent
48b5cdf5c8
commit
b0d7c6135d
@ -12,7 +12,7 @@ router.beforeEach(async (to, from, next) => {
|
||||
if (to.path == "/") {
|
||||
next({ path: "/home" });
|
||||
} else if (to.matched.length === 0) {
|
||||
from.name ? next({ name: from.name }) : next({ path: "/404" });
|
||||
from.name ? next({ name: from.name }) : next({ path: "/" });
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ const routes = [
|
||||
|
||||
const createRouter = () =>
|
||||
new VueRouter({
|
||||
base: "/official-website/",
|
||||
base: "/",
|
||||
mode: "history",
|
||||
routes
|
||||
});
|
||||
|
Reference in New Issue
Block a user