|
@@ -2,6 +2,7 @@ import Vue from 'vue'
|
|
|
import VueRouter from 'vue-router'
|
|
|
import Cookies from "js-cookie";
|
|
|
import Store from '@/store'
|
|
|
+import config from '@/config';
|
|
|
Vue.use(VueRouter)
|
|
|
|
|
|
const originalPush = VueRouter.prototype.push
|
|
@@ -557,9 +558,18 @@ const router = new VueRouter({
|
|
|
})
|
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
-
|
|
|
- if (to.path === '/admin/login'||to.path==='/'){next()}
|
|
|
+// 获取网页的来源地址
|
|
|
+var refull = document.referrer;
|
|
|
+ if (to.path === '/admin/login'||to.path==='/'){
|
|
|
+ if (to.meta.title) {
|
|
|
+ document.title = to.meta.title;
|
|
|
+ }
|
|
|
+ next()
|
|
|
+ }
|
|
|
else if(to.meta.allowPath){
|
|
|
+ if (to.meta.title) {
|
|
|
+ document.title = to.meta.title;
|
|
|
+ }
|
|
|
next()
|
|
|
}
|
|
|
else{
|
|
@@ -567,13 +577,20 @@ router.beforeEach((to, from, next) => {
|
|
|
|
|
|
switch(tokenStr){
|
|
|
case undefined:
|
|
|
+ if (to.meta.title) {
|
|
|
+ document.title = to.meta.title;
|
|
|
+ }
|
|
|
next({name:'Login',params:{ redirect:to.fullPath}})
|
|
|
break
|
|
|
default:
|
|
|
+ if (to.meta.title) {
|
|
|
+ document.title = to.meta.title;
|
|
|
+ }
|
|
|
next()
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
|
|
|
// 增加判断条件
|
|
|
// if (tokenStr)
|