|
@@ -11,22 +11,23 @@ export default {
|
11
|
11
|
this.$store.dispatch('VerifyToken', this.$route.query.token).then(() => {
|
12
|
12
|
this.$store.dispatch('xt_GenerateRoutes', this.$store.getters.current_role_urls).then(() => {
|
13
|
13
|
this.$store.dispatch('VerifyConfigList').then(() => {
|
14
|
|
- if(sessionStorage.getItem('signIn') != null){
|
15
|
|
- this.$router.replace({ path: '/signIn' })
|
16
|
|
- }else{
|
|
14
|
+
|
17
|
15
|
// alert('token 验证成功')
|
18
|
16
|
// console.log(this.$store.getters.xt_permission.addRouters)
|
19
|
17
|
this.$router.addRoutes(this.$store.getters.xt_permission.addRouters) // 动态添加可访问路由表
|
20
|
18
|
// next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
|
21
|
|
- if(this.$store.getters.current_role_urls.includes('/dialysis/dialysisrecord')){
|
22
|
|
- this.$router.replace({ path: '/dialysis/dialysisrecord' })
|
23
|
|
-
|
|
19
|
+ if(sessionStorage.getItem('signIn') != null){
|
|
20
|
+ this.$router.replace({ path: '/signIn' })
|
24
|
21
|
}else{
|
25
|
|
- this.$router.replace({ path: '/home' })
|
|
22
|
+ if(this.$store.getters.current_role_urls.includes('/dialysis/dialysisrecord')){
|
|
23
|
+ this.$router.replace({ path: '/dialysis/dialysisrecord' })
|
|
24
|
+
|
|
25
|
+ }else{
|
|
26
|
+ this.$router.replace({ path: '/home' })
|
26
|
27
|
|
27
|
28
|
|
|
29
|
+ }
|
28
|
30
|
}
|
29
|
|
- }
|
30
|
31
|
|
31
|
32
|
})
|
32
|
33
|
})
|