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
10d18ac8
Commit
10d18ac8
authored
Sep 03, 2020
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复跳转后页面空白的bug
parent
7310c2a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
permission.js
src/utils/permission.js
+9
-6
request.js
src/utils/request.js
+1
-1
No files found.
src/utils/permission.js
View file @
10d18ac8
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
* @LastEditTime: 2020-08-17 15:31:44
* @LastEditTime: 2020-08-17 15:31:44
*/
*/
import
{
request
}
from
'./request.js'
;
import
{
request
}
from
'./request.js'
;
import
{
origin
}
from
'@/config'
;
// 项目中配置的路由信息
// 项目中配置的路由信息
let
projectRoutes
=
[];
let
projectRoutes
=
[];
...
@@ -17,11 +16,15 @@ let accessPath = [];
...
@@ -17,11 +16,15 @@ let accessPath = [];
let
itemPermission
=
{};
let
itemPermission
=
{};
function
getGicMenu
()
{
function
getGicMenu
()
{
const
getUserMenu
=
request
({
url
:
'/hb-manage-web/list-staff-role-menu'
}).
then
(
res
=>
{
const
getUserMenu
=
new
Promise
(
resolve
=>
{
accessPath
=
getProjectMenu
(
res
.
result
||
[]);
request
({
url
:
'/hb-manage-web/list-staff-role-menu'
}).
then
(
res
=>
{
accessPath
=
getProjectMenu
(
res
.
result
||
[]);
}).
finally
(
resolve
);
});
});
const
getUserOperation
=
request
({
url
:
'/hb-manage-web/list-staff-role-opeation'
}).
then
(
res
=>
{
const
getUserOperation
=
new
Promise
(
resolve
=>
{
itemPermission
=
getItemPerm
(
res
.
result
||
[]);
request
({
url
:
'/hb-manage-web/list-staff-role-opeation'
}).
then
(
res
=>
{
itemPermission
=
getItemPerm
(
res
.
result
||
[]);
}).
finally
(
resolve
);
});
});
return
Promise
.
all
([
getUserMenu
,
getUserOperation
]);
return
Promise
.
all
([
getUserMenu
,
getUserOperation
]);
}
}
...
@@ -69,7 +72,7 @@ function intercept(to, from, next) {
...
@@ -69,7 +72,7 @@ function intercept(to, from, next) {
};
};
// 无权限访问
// 无权限访问
if
(
projectRoutes
.
some
(
el
=>
el
==
to
.
path
)
||
accessPath
.
length
==
0
)
{
if
(
projectRoutes
.
some
(
el
=>
el
==
to
.
path
)
||
accessPath
.
length
==
0
)
{
window
.
location
.
href
=
`
${
origin
}
/haoban-4/#/gic-error`
;
next
(
'/gic-error'
)
;
}
else
{
}
else
{
next
(
accessPath
[
0
]);
next
(
accessPath
[
0
]);
}
}
...
...
src/utils/request.js
View file @
10d18ac8
...
@@ -52,7 +52,7 @@ const request = (opt, params) => {
...
@@ -52,7 +52,7 @@ const request = (opt, params) => {
if
(
resp
.
code
==
notAuthCode
)
{
if
(
resp
.
code
==
notAuthCode
)
{
window
.
location
.
href
=
`
${
origin
}
/haoban-4/#/login`
;
window
.
location
.
href
=
`
${
origin
}
/haoban-4/#/login`
;
return
;
return
reject
(
resp
)
;
}
}
if
(
requestConfig
.
useIntercept
&&
resp
.
code
!=
succCode
)
{
if
(
requestConfig
.
useIntercept
&&
resp
.
code
!=
succCode
)
{
Message
({
Message
({
...
...
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