Skip to content

Commit 5e5a076

Browse files
authored
fix: 默认路由解析添加参数问题修复 (#6160)
1 parent 5026e43 commit 5e5a076

File tree

6 files changed

+47
-17
lines changed

6 files changed

+47
-17
lines changed

bklog/web/src/App.vue

+1
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@
262262

263263
this.$store.state.isExternal = window.IS_EXTERNAL ? JSON.parse(window.IS_EXTERNAL) : false;
264264
},
265+
265266
methods: {
266267
/** 初始化脱敏灰度相关的数据 */
267268
initMaskingToggle() {

bklog/web/src/main.js

-12
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,6 @@ const mountedVueInstance = router => {
8282
App,
8383
},
8484
template: '<App/>',
85-
mounted() {
86-
const bkBizId = this.$store.state.bkBizId;
87-
const spaceUid = this.$store.state.spaceUid;
88-
89-
this.$router.replace({
90-
query: {
91-
...this.$route.query,
92-
bizId: bkBizId,
93-
spaceUid: spaceUid,
94-
},
95-
});
96-
},
9785
});
9886
});
9987
};

bklog/web/src/views/extract/index.vue

+12
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@
7373
this.isLoading = bool;
7474
},
7575
},
76+
mounted() {
77+
const bkBizId = this.$store.state.bkBizId;
78+
const spaceUid = this.$store.state.spaceUid;
79+
80+
this.$router.replace({
81+
query: {
82+
bizId: bkBizId,
83+
spaceUid: spaceUid,
84+
...this.$route.query,
85+
},
86+
});
87+
},
7688
};
7789
</script>
7890

bklog/web/src/views/manage/index.vue

+12
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@
8989
this.isExpand = data;
9090
},
9191
},
92+
mounted() {
93+
const bkBizId = this.$store.state.bkBizId;
94+
const spaceUid = this.$store.state.spaceUid;
95+
96+
this.$router.replace({
97+
query: {
98+
bizId: bkBizId,
99+
spaceUid: spaceUid,
100+
...this.$route.query,
101+
},
102+
});
103+
},
92104
};
93105
</script>
94106

bklog/web/src/views/retrieve-v3/use-app-init.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,17 @@ export default () => {
271271
/** * 结束计算 ***/
272272
onMounted(() => {
273273
RetrieveHelper.onMounted();
274+
275+
const bkBizId = store.state.bkBizId;
276+
const spaceUid = store.state.spaceUid;
277+
278+
router.replace({
279+
query: {
280+
bizId: bkBizId,
281+
spaceUid: spaceUid,
282+
...route.query,
283+
},
284+
});
274285
});
275286

276287
onUnmounted(() => {

bklog/web/src/views/retrieve/index.vue

+11-5
Original file line numberDiff line numberDiff line change
@@ -602,13 +602,19 @@
602602
},
603603
mounted() {
604604
window.bus.$on('retrieveWhenChartChange', this.retrieveWhenChartChange);
605+
606+
const bkBizId = this.$store.state.bkBizId;
607+
const spaceUid = this.$store.state.spaceUid;
608+
609+
this.$router.replace({
610+
query: {
611+
bizId: bkBizId,
612+
spaceUid: spaceUid,
613+
...this.$route.query,
614+
},
615+
});
605616
},
606-
// beforeUnmount() {
607-
// updateTimezone();
608-
// this.$store.commit('updateUnionIndexList', []);
609-
// window.bus.$off('retrieveWhenChartChange', this.retrieveWhenChartChange);
610617

611-
// },
612618
beforeDestroy() {
613619
this.isInDestroy = true;
614620
updateTimezone();

0 commit comments

Comments
 (0)