Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mt-education-mobile
Project
Project
Details
Activity
Releases
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
王旭
mt-education-mobile
Commits
2e8a48b0
Commit
2e8a48b0
authored
Dec 10, 2020
by
zhangyichen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试失败返回
parent
ebf0a159
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
6 deletions
+40
-6
permission.js
src/permission.js
+40
-6
No files found.
src/permission.js
View file @
2e8a48b0
...
...
@@ -9,9 +9,11 @@ function getButtons() {
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
console
.
log
(
'butonInfo is ok'
)
}).
catch
((
err
)
=>
{
router
.
go
(
-
1
)
console
.
log
(
err
)
})
}
else
{
router
.
go
(
-
1
)
console
.
log
(
'butonInfo is already'
)
}
}
...
...
@@ -29,8 +31,17 @@ router.beforeEach((to, from, next) => {
console
.
log
(
'总体链接:'
+
window
.
location
.
href
)
if
(
userCode
||
sessionStorage
.
getItem
(
'userCode'
))
{
if
(
from
.
name
!==
null
)
{
getButtons
()
next
()
if
(
store
.
state
.
buttons
==
null
)
{
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
next
()
}).
catch
((
err
)
=>
{
router
.
go
(
-
1
)
console
.
log
(
err
)
})
}
else
{
router
.
go
(
-
1
)
console
.
log
(
'butonInfo is already'
)
}
}
else
{
getToken
(
data
).
then
(
res
=>
{
localStorage
.
setItem
(
'task_accessToken'
,
res
.
data
.
data
.
access_token
)
...
...
@@ -45,17 +56,40 @@ router.beforeEach((to, from, next) => {
}
}
sessionStorage
.
setItem
(
'userId'
,
targetUserId
)
getButtons
()
next
()
if
(
store
.
state
.
buttons
==
null
)
{
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
next
()
}).
catch
((
err
)
=>
{
router
.
go
(
-
1
)
console
.
log
(
err
)
})
}
else
{
router
.
go
(
-
1
)
console
.
log
(
'butonInfo is already'
)
}
}).
catch
((
err
)
=>
{
router
.
go
(
-
1
)
console
.
log
(
err
)
})
}).
catch
((
err
)
=>
{
router
.
go
(
-
1
)
console
.
log
(
err
)
})
}
}
else
{
console
.
log
(
'url中未找到userCode'
)
// sessionStorage.setItem('corpId', '6')
// sessionStorage.setItem('userId', '1042237477509636097')
getButtons
()
next
()
if
(
store
.
state
.
buttons
==
null
)
{
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
next
()
}).
catch
((
err
)
=>
{
router
.
go
(
-
1
)
console
.
log
(
err
)
})
}
else
{
console
.
log
(
'butonInfo is already'
)
}
}
}
})
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