@@ -20,6 +20,7 @@ import Vue from 'vue';
2020import Router from 'vue-router' ;
2121import { pluginRouter } from './plugin' ;
2222import { platformRouters } from './platform' ;
23+ import { installNavigationCompat } from './navigation-compat' ;
2324import store from '@/store' ;
2425
2526const frontPage = ( ) => import ( /* webpackChunkName: 'front-page' */ '@/views/index' ) . then ( module => module ) . catch ( ( error ) => {
@@ -376,6 +377,8 @@ const permission403 = () => import(/* webpackChunkName: 'permission403' */'@/vie
376377
377378Vue . use ( Router ) ;
378379
380+ installNavigationCompat ( Router ) ;
381+
379382const router = new Router ( {
380383 mode : 'history' ,
381384 // web url path
@@ -744,6 +747,13 @@ const router = new Router({
744747 } ,
745748 {
746749 path : 'module-info' ,
750+ redirect : to => ( {
751+ name : 'moduleInfo' ,
752+ params : to . params ,
753+ query : to . query ,
754+ } ) ,
755+ } ,
756+ {
747757 path : 'info' ,
748758 component : moduleInfo ,
749759 name : 'moduleInfo' ,
@@ -827,9 +837,11 @@ const router = new Router({
827837 path : ':id/deployments' ,
828838 component : cloudAppDeployManage ,
829839 name : 'cloudAppDeployManage' ,
830- redirect : {
831- name : 'cloudAppDeployForProcess' ,
832- } ,
840+ redirect : to => ( {
841+ name : 'cloudAppDeployManageStag' ,
842+ params : to . params ,
843+ query : to . query ,
844+ } ) ,
833845 children : [
834846 {
835847 path : 'stag' ,
@@ -1123,7 +1135,7 @@ const router = new Router({
11231135 } ,
11241136 {
11251137 path : '/developer-center/apps/:id/create/gitee/success' ,
1126- name : 'createGithubAppSucc ' ,
1138+ name : 'createGiteeAppSucc ' ,
11271139 component : createGitAppSucc ,
11281140 } ,
11291141 {
@@ -1148,7 +1160,7 @@ router.beforeEach(async (to, from, next) => {
11481160 sessionStorage . setItem ( 'NOTICE' , true ) ;
11491161 if ( window . location . href . indexOf ( window . GLOBAL_CONFIG . V3_OA_DOMAIN ) !== - 1 ) {
11501162 const url = window . location . href . replace ( window . GLOBAL_CONFIG . V3_OA_DOMAIN , window . GLOBAL_CONFIG . V3_WOA_DOMAIN ) ;
1151- window . location . replace ( url ) ;
1163+ return window . location . replace ( url ) ;
11521164 } else {
11531165 const checkUserFeature = async ( featureKey ) => {
11541166 // 可能为页面刷新重新调用获取功能开关
@@ -1158,11 +1170,12 @@ router.beforeEach(async (to, from, next) => {
11581170 store . state . userFeature [ featureKey ] ? next ( ) : next ( { name : '404' } ) ;
11591171 } ;
11601172 if ( to . path . startsWith ( '/plugin-center' ) ) {
1161- checkUserFeature ( 'ALLOW_PLUGIN_CENTER' ) ;
1173+ await checkUserFeature ( 'ALLOW_PLUGIN_CENTER' ) ;
11621174 } else if ( to . path . startsWith ( '/plat-mgt' ) ) {
1163- checkUserFeature ( 'PLATFORM_MANAGEMENT' ) ;
1175+ await checkUserFeature ( 'PLATFORM_MANAGEMENT' ) ;
1176+ } else {
1177+ next ( ) ;
11641178 }
1165- next ( ) ;
11661179 }
11671180} ) ;
11681181
0 commit comments