Commit 387fcb67 by 无尘

fix: 修改接口 header 参数

parent 34e5bb21
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-07-31 11:41:34 * @Date: 2020-07-31 11:41:34
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-09-21 11:17:01 * @LastEditTime: 2020-09-21 11:31:23
*/ */
import { request } from './request.js'; import { request } from './request.js';
import axios from 'axios'; import axios from 'axios';
...@@ -91,10 +91,11 @@ let permission = function(config) { ...@@ -91,10 +91,11 @@ let permission = function(config) {
// 获取菜单数据 // 获取菜单数据
// 获取权限数据 // 获取权限数据
const path = window.location.href; const path = window.location.href;
const hashName = window.location.hash;
if (path.indexOf('/login') == -1 && path.indexOf('/gic-error') == -1) { if (path.indexOf('/login') == -1 && path.indexOf('/gic-error') == -1) {
Object.assign(axios.defaults.headers.common, { Object.assign(axios.defaults.headers.common, {
project: projectPath, project: projectPath,
route: window.location.hash.match(/(?<=\#\/).*?(?=\?)/)[0] route: hashName.includes('?') ? hashName.match(/(?<=\#\/).*?(?=\?)/)[0] : hashName.match(/(?<=\#\/).*/)
}); });
await getGicMenu(); await getGicMenu();
} }
......
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