From 9ee1c2a87518d0a848e0481410a18e019357f11e Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Sat, 27 Jan 2024 11:50:47 +0800 Subject: [PATCH] fix --- src/views/LoginPage.vue | 8 +++++++- src/views/OldHistoryPage.vue | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/views/LoginPage.vue b/src/views/LoginPage.vue index 07670553..cd8f15e1 100644 --- a/src/views/LoginPage.vue +++ b/src/views/LoginPage.vue @@ -523,7 +523,13 @@ export default defineComponent({ //跳转到首页 turnToHomePage() { this.getLang() - this.$router.push("/home"); + // this.$router.push("/home"); + // console.log(window.location.search.substring(1)); + if(window.location.search.substring(1) == 'oldHis'){ + this.$router.push("/oldHistory"); + }else{ + this.$router.push("/home"); + } }, //获取当前语言 getLang(){ diff --git a/src/views/OldHistoryPage.vue b/src/views/OldHistoryPage.vue index 55734ada..42a07837 100644 --- a/src/views/OldHistoryPage.vue +++ b/src/views/OldHistoryPage.vue @@ -145,6 +145,12 @@ export default defineComponent({ }, mounted(){ let userInfo:any = getCookie("userInfo") + let str = window.location.search.substring(1) + if(!userInfo){ + this.$router.push(`/login?${str}`).then(()=>{ + window.location.reload(); + }); + } this.userInfo = JSON.parse(userInfo); let historyTable:any = this.$refs.historyTable this.historyTableHeight = historyTable.clientHeight - 130