|
@@ -1,9 +1,7 @@
|
|
|
import Vue from "vue"
|
|
|
import store from "@/store"
|
|
|
import VueRouter from "vue-router"
|
|
|
-import {
|
|
|
- query
|
|
|
-} from "@/utils/query"
|
|
|
+import { query } from "@/utils/query"
|
|
|
Vue.use(VueRouter)
|
|
|
|
|
|
const routes = [
|
|
@@ -22,7 +20,8 @@ const routes = [
|
|
|
name: "home",
|
|
|
component: () => import("../views/index"),
|
|
|
redirect: "/home/first",
|
|
|
- children: [{
|
|
|
+ children: [
|
|
|
+ {
|
|
|
path: "first",
|
|
|
component: () => import("../views/first"),
|
|
|
},
|
|
@@ -70,7 +69,7 @@ const router = new VueRouter({
|
|
|
routes,
|
|
|
})
|
|
|
//不需要token的路由
|
|
|
-const ignore = ["/404", "/legendLibrary", "/legendRules"]
|
|
|
+const ignore = ["/404"]
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
if (!ignore.includes(to.path)) {
|
|
|
const token = query().token
|
|
@@ -95,7 +94,9 @@ router.beforeEach(async (to, from, next) => {
|
|
|
let ssoServer = "http://oauth.wanda-dev.cn"
|
|
|
let systemcode = "CAD156",
|
|
|
signal = new Date().getTime(),
|
|
|
- version = "1.0.0"
|
|
|
+ version = "1.0.0",
|
|
|
+ returnUrl = window.location.protocol + '//' + window.location.host
|
|
|
+
|
|
|
window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
|
|
|
}
|
|
|
} else {
|
|
@@ -103,4 +104,4 @@ router.beforeEach(async (to, from, next) => {
|
|
|
return
|
|
|
}
|
|
|
})
|
|
|
-export default router
|
|
|
+export default router
|