|
@@ -1,7 +1,7 @@
|
|
|
import Vue from 'vue'
|
|
|
import Router from 'vue-router'
|
|
|
import { hidden_xzqh, hidden_wall } from "@/common/js/cockpit.js";
|
|
|
-
|
|
|
+import { setToken } from '@/utils/auth'
|
|
|
Vue.use(Router)
|
|
|
|
|
|
|
|
@@ -152,6 +152,17 @@ const router = new Router({
|
|
|
scrollBehavior: () => ({ y: 0 }),
|
|
|
routes: constantRoutes
|
|
|
})
|
|
|
-
|
|
|
+router.beforeEach(async (to, from, next) => {
|
|
|
+ // document.title = getPageTitle(to.meta.title)
|
|
|
+ var hrefs = to.path//window.location.href
|
|
|
+ let hrefIdx = hrefs.indexOf('token=');
|
|
|
+ let token = hrefs.substring(hrefIdx + 10, hrefs.length);
|
|
|
+ if (hrefIdx > -1) {
|
|
|
+ setToken(token)
|
|
|
+ next('/siteselection');
|
|
|
+ } else {
|
|
|
+ next()
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
export default router;
|