Commit b088bbbf by 无尘

fix: 修改接口 header 参数

parent 8065c58f
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-07-16 16:37:05
* @LastEditors: 无尘
* @LastEditTime: 2020-09-18 16:37:31
* @LastEditTime: 2020-09-21 11:04:53
*/
import 'babel-polyfill';
import 'element-ui/lib/theme-chalk/index.css';
......@@ -42,6 +42,7 @@ Object.keys(filters).forEach(key => {
});
/* eslint-disable no-new */
permission({
projectPath: 'haoban',
whiteRoute: [ '/login', '/contactsList', '/apps', '/gic-error', '/403', '/404', '/500' ],
router,
routes,
......
......@@ -4,9 +4,10 @@
* @Author: 无尘
* @Date: 2020-07-31 11:41:34
* @LastEditors: 无尘
* @LastEditTime: 2020-08-17 15:31:44
* @LastEditTime: 2020-09-21 11:14:23
*/
import { request } from './request.js';
import axios from 'axios';
// 项目中配置的路由信息
let projectRoutes = [];
......@@ -84,13 +85,17 @@ function itemPerm(itemPermCode) {
}
let permission = function(config) {
const { whiteRoute, router, routes, createApp } = config;
const { projectPath, whiteRoute, router, routes, createApp } = config;
window.onload = async function() {
// 获取菜单数据
// 获取权限数据
const path = window.location.href;
if (path.indexOf('/login') == -1 && path.indexOf('/gic-error') == -1) {
Object.assign(axios.defaults.headers.common, {
project: projectPath,
route: window.location.hash.match(/(?<=\#\/).*?(?=\?)/)
});
await getGicMenu();
}
if (Array.isArray(whiteRoute)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment