Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-4
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
office
haoban-4
Commits
b088bbbf
Commit
b088bbbf
authored
Sep 21, 2020
by
无尘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改接口 header 参数
parent
8065c58f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
main.js
src/main.js
+2
-1
permission.js
src/utils/permission.js
+7
-2
No files found.
src/main.js
View file @
b088bbbf
...
...
@@ -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
,
...
...
src/utils/permission.js
View file @
b088bbbf
...
...
@@ -4,9 +4,10 @@
* @Author: 无尘
* @Date: 2020-07-31 11:41:34
* @LastEditors: 无尘
* @LastEditTime: 2020-0
8-17 15:31:44
* @LastEditTime: 2020-0
9-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
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment