mirror of
https://gitee.com/log4j/pig-ui.git
synced 2025-01-03 23:42:23 +08:00
修改token为access_token
This commit is contained in:
parent
0383ca744b
commit
29f01214c3
@ -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'),
|
||||
|
@ -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);
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user