修复history回来的数据bug

This commit is contained in:
X1627315083
2024-03-27 16:42:52 +08:00
parent b9263d5ca1
commit 005ad258c1
3 changed files with 84 additions and 18 deletions

View File

@@ -440,7 +440,11 @@ export default defineComponent({
// console.log(this.store.state.UserHabit);
let noRefresh = this.$route.params.noRefresh; //判断是否主动刷新还是路由跳转过来的 true 路由跳转过来的
if (noRefresh) {
window.addEventListener('beforeunload', (event)=>{
this.store.commit("setUserGroupId", this.$route.params.id);
this.store.commit("clearAllCollection");
});
if (this.$route.name == "homePage") {
let colorBoards =
this.store.state.UploadFilesModule.allBoardData.colorBoards ||
[];
@@ -448,11 +452,12 @@ export default defineComponent({
this.isHaveReviewCollection = true;
}
} else {
this.store.commit("setUserGroupId", this.$route.params.id);
this.store.commit("clearAllCollection");
// this.store.commit("setUserGroupId", this.$route.params.id);
// this.store.commit("clearAllCollection");
}
if (this.$route.params.id) {
this.getHistoryChoose(this.$route.params.id, "normal");
this.store.commit("setDesignCollectionList",[]);
} else {
this.store.commit("clearAllData");
}