修改token为access_token

This commit is contained in:
smallwei 2018-03-25 19:46:24 +08:00
parent 0383ca744b
commit 29f01214c3
2 changed files with 9 additions and 7 deletions

View File

@ -1,6 +1,6 @@
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
var baseUrl = 'http://218.70.11.118:7777';
var baseUrl = 'http://192.168.0.101:9999';
module.exports = {
build: {
env: require('./prod.env'),

View File

@ -5,6 +5,7 @@ import { vaildUtil } from '@/util/yun';
import { setTitle } from '@/util/util';
import { validatenull } from '@/util/validate';
import { asyncRouterMap } from '@/router/router'
import { Duplex } from 'stream';
function hasPermission(roles, permissionRoles) {
if (!permissionRoles) return true
return roles.some(role => permissionRoles.indexOf(role) >= 0)
@ -14,7 +15,7 @@ const lockPage = '/lock'
router.addRoutes(asyncRouterMap); // 动态添加可访问路由表
router.beforeEach((to, from, next) => {
store.commit('SET_TAG', to.query.src ? to.query.src : to.path);
if (store.getters.token) { // determine if there has token
if (store.getters.access_token) { // determine if there has token
/* has token*/
if (store.getters.isLock && to.path != lockPage) {
next({ path: lockPage })
@ -73,10 +74,12 @@ function findMenuParent(tag) {
return false;
}
})[0];
if (!validatenull(tagCurrent)) {
tagCurrent.push({
label: currentPathObj.label,
value: currentPathObj.path
});
}
tagCurrent.push(tag);
return tagCurrent;
@ -85,7 +88,6 @@ router.afterEach((to, from) => {
setTimeout(() => {
const tag = store.getters.tag;
setTitle(tag.label);
alert(findMenuParent(tag));
store.commit('SET_TAG_CURRENT', findMenuParent(tag));
}, 0);
})