fix: 新旧版本切换时首页展示问题

修复缺陷:进行新旧版本切换时,接口测试功能的首页没有跟随新旧版本进行切换
This commit is contained in:
song.tianyang 2020-12-17 18:22:18 +08:00
parent 66c01949af
commit 3e4b38e394
3 changed files with 15 additions and 3 deletions

View File

@ -5,7 +5,10 @@
<el-col :span="14">
<el-menu class="header-menu" :unique-opened="true" mode="horizontal" router :default-active='$route.path'>
<el-menu-item :index="'/api/home'">
<el-menu-item v-show="$store.state.switch.value=='new'" :index="'/api/home'">
{{ $t("i18n.home") }}
</el-menu-item>
<el-menu-item v-show="$store.state.switch.value=='old'" :index="'/api/home_obsolete'">
{{ $t("i18n.home") }}
</el-menu-item>

View File

@ -11,9 +11,13 @@ export default {
{
path: 'home',
name: 'fucHome',
// component: () => import('@/business/components/api/home/ApiTestHome'),
component: () => import('@/business/components/api/homepage/ApiTestHomePage'),
},
{
path: 'home_obsolete',
name: 'fucHome',
component: () => import('@/business/components/api/home/ApiTestHome'),
},
{
path: "test/:type",
name: "ApiTestConfig",

View File

@ -77,7 +77,12 @@
this.isReadOnly = !this.isReadOnly
this.$store.commit('setFlag', this.isReadOnly);
this.$store.commit('setValue', item);
window.location.href = "/#/api/home";
if(item=="old"){
window.location.href = "/#/api/home_obsolete";
}else {
window.location.href = "/#/api/home";
}
}
}
}