|
|
|
|
@ -3,10 +3,10 @@ import { createRouter, createWebHashHistory } from 'vue-router'
@@ -3,10 +3,10 @@ import { createRouter, createWebHashHistory } from 'vue-router'
|
|
|
|
|
import NProgress from 'nprogress' |
|
|
|
|
import 'nprogress/nprogress.css' |
|
|
|
|
// 导入路由组件
|
|
|
|
|
import * as badgeRouter from './badge' |
|
|
|
|
// import * as cartoonRouter from './cartoon'
|
|
|
|
|
import badge from '@/views/badge/index.vue' |
|
|
|
|
// import cartoon from '@/views/cartoon/index.vue'
|
|
|
|
|
// import * as badgeRouter from './badge'
|
|
|
|
|
import * as cartoonRouter from './cartoon' |
|
|
|
|
// import badge from '@/views/badge/index.vue'
|
|
|
|
|
import cartoon from '@/views/cartoon/index.vue' |
|
|
|
|
import {useStore} from '@/stores' |
|
|
|
|
import { config } from '@/config/config' |
|
|
|
|
import { localStorage } from '@/utils/local-storage' |
|
|
|
|
@ -17,8 +17,8 @@ NProgress.configure({ showSpinner: true, parent: '#app' })
@@ -17,8 +17,8 @@ NProgress.configure({ showSpinner: true, parent: '#app' })
|
|
|
|
|
const routes = [ |
|
|
|
|
{ |
|
|
|
|
path: '/', |
|
|
|
|
name: 'badge', |
|
|
|
|
component: badge, |
|
|
|
|
name: 'cartoon', |
|
|
|
|
component: cartoon, |
|
|
|
|
meta: { |
|
|
|
|
needGuard: true, |
|
|
|
|
title: '首页', |
|
|
|
|
@ -26,8 +26,8 @@ const routes = [
@@ -26,8 +26,8 @@ const routes = [
|
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
badgeRouter.mergeRoutes(routes) |
|
|
|
|
// cartoonRouter.mergeRoutes(routes)
|
|
|
|
|
// badgeRouter.mergeRoutes(routes)
|
|
|
|
|
cartoonRouter.mergeRoutes(routes) |
|
|
|
|
// 创建路由实例并传递 `routes` 配置
|
|
|
|
|
const router = createRouter({ |
|
|
|
|
history: createWebHashHistory(process.env.VUE_APP_PUBLIC_PATH), |
|
|
|
|
@ -56,7 +56,7 @@ router.beforeEach((_to, _from, next) => {
@@ -56,7 +56,7 @@ router.beforeEach((_to, _from, next) => {
|
|
|
|
|
if (code) { |
|
|
|
|
let url = store.redirectUrl() |
|
|
|
|
|
|
|
|
|
if (_to.path !== '/badge') { |
|
|
|
|
if (_to.path !== '/cartoon') { |
|
|
|
|
if (url) { |
|
|
|
|
store.setRedirect('') |
|
|
|
|
next(url) |
|
|
|
|
|