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
41567ed6
Commit
41567ed6
authored
Dec 11, 2020
by
zhangyichen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
失败后跳转
parent
b22422a0
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1303 deletions
+51
-1303
router.config.js
src/config/router.config.js
+6
-6
permission.js
src/permission.js
+19
-8
index.vue
src/views/HomeIndex/index.vue
+26
-1289
No files found.
src/config/router.config.js
View file @
41567ed6
...
@@ -5,12 +5,12 @@
...
@@ -5,12 +5,12 @@
* @type { *[] }
* @type { *[] }
*/
*/
export
const
defaultRoutes
=
[
export
const
defaultRoutes
=
[
//
//
首页
// 首页
//
{
{
// path: '/Home
',
path
:
'/HomeIndex
'
,
// name: 'Home
',
name
:
'HomeIndex
'
,
// component: (resolve) => require(['@/views/Home
'], resolve)
component
:
(
resolve
)
=>
require
([
'@/views/HomeIndex
'
],
resolve
)
//
},
},
{
{
path
:
'/'
,
path
:
'/'
,
name
:
'Home'
,
name
:
'Home'
,
...
...
src/permission.js
View file @
41567ed6
import
router
from
'@/router'
import
router
from
'@/router'
import
{
getUrlParam
}
from
'@/utils'
import
{
getUrlParam
}
from
'@/utils'
import
{
getToken
,
getUserId
}
from
'@/api/test'
import
{
getToken
,
getUserId
}
from
'@/api/test'
import
{
sendInfoToJava
}
from
'@/utils/mt-utils'
import
store
from
'@/store'
import
store
from
'@/store'
const
whiteList
=
[
'/CourseTrainOut'
,
'/CourseTrainOutPotal'
]
// 不重定向白名单
const
whiteList
=
[
'/CourseTrainOut'
,
'/CourseTrainOutPotal'
,
'/HomeIndex'
]
// 不重定向白名单
function
getButtons
()
{
function
getButtons
()
{
if
(
store
.
state
.
buttons
==
null
)
{
if
(
store
.
state
.
buttons
==
null
)
{
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
console
.
log
(
'butonInfo is ok'
)
console
.
log
(
'butonInfo is ok'
)
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
sendInfoToJava
(
'close'
)
router
.
replace
({
name
:
'HomeIndex'
})
console
.
log
(
err
)
console
.
log
(
err
)
})
})
}
else
{
}
else
{
...
@@ -35,7 +36,9 @@ router.beforeEach((to, from, next) => {
...
@@ -35,7 +36,9 @@ router.beforeEach((to, from, next) => {
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
next
()
next
()
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
sendInfoToJava
(
'close'
)
router
.
replace
({
name
:
'HomeIndex'
})
console
.
log
(
err
)
console
.
log
(
err
)
})
})
}
else
{
}
else
{
...
@@ -60,7 +63,9 @@ router.beforeEach((to, from, next) => {
...
@@ -60,7 +63,9 @@ router.beforeEach((to, from, next) => {
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
next
()
next
()
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
sendInfoToJava
(
'close'
)
router
.
replace
({
name
:
'HomeIndex'
})
console
.
log
(
err
)
console
.
log
(
err
)
})
})
}
else
{
}
else
{
...
@@ -68,11 +73,15 @@ router.beforeEach((to, from, next) => {
...
@@ -68,11 +73,15 @@ router.beforeEach((to, from, next) => {
console
.
log
(
'butonInfo is already'
)
console
.
log
(
'butonInfo is already'
)
}
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
sendInfoToJava
(
'close'
)
router
.
replace
({
name
:
'HomeIndex'
})
console
.
log
(
err
)
console
.
log
(
err
)
})
})
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
sendInfoToJava
(
'close'
)
router
.
replace
({
name
:
'HomeIndex'
})
console
.
log
(
err
)
console
.
log
(
err
)
})
})
}
}
...
@@ -84,7 +93,9 @@ router.beforeEach((to, from, next) => {
...
@@ -84,7 +93,9 @@ router.beforeEach((to, from, next) => {
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
store
.
dispatch
(
'GetButtonInfo'
).
then
(
res
=>
{
// 拉取用户信息
next
()
next
()
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
sendInfoToJava
(
'close'
)
router
.
replace
({
name
:
'HomeIndex'
})
console
.
log
(
err
)
console
.
log
(
err
)
})
})
}
else
{
}
else
{
...
...
src/views/HomeIndex/index.vue
View file @
41567ed6
This diff is collapsed.
Click to expand it.
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