From 11a885d0395b96b5cedcfa169e6ea2e3c64bb402 Mon Sep 17 00:00:00 2001 From: "34701892@qq.com" <34701892@qq.com> Date: Sun, 9 Nov 2025 22:56:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E7=8E=AF=E5=A2=83API=E5=9C=B0=E5=9D=80=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=99=BB=E5=BD=95=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将生产环境API地址切换为正式域名 - 修改登录失效处理方式为页面刷新而非跳转 - 优化rank.vue页面布局和路由参数处理 - 移除登录页面的token参数 --- .env.production | 4 +-- src/pages/realtimeInfo/pc/rank.vue | 44 ++++++++++++++---------------- src/utils/index.ts | 5 ++-- 3 files changed, 25 insertions(+), 28 deletions(-) diff --git a/.env.production b/.env.production index de01dda..8ff2d92 100644 --- a/.env.production +++ b/.env.production @@ -3,8 +3,8 @@ ENV = production # 线上环境接口地址 # VITE_API_URL = https://cankao.cs.com.cn/mini -VITE_API_URL = http://123.60.153.169:8040/apih5 -# VITE_API_URL = https://cankao.cs.com.cn/apih5 +# VITE_API_URL = http://123.60.153.169:8040/apih5 +VITE_API_URL = https://cankao.cs.com.cn/apih5 # VITE_API_URL = http://123.60.79.143:8041/apih5 diff --git a/src/pages/realtimeInfo/pc/rank.vue b/src/pages/realtimeInfo/pc/rank.vue index 2bf6fcd..ba380bd 100644 --- a/src/pages/realtimeInfo/pc/rank.vue +++ b/src/pages/realtimeInfo/pc/rank.vue @@ -7,14 +7,9 @@ 资讯头条榜 编辑精选 - + style="margin-left: 40rpx; margin-top: 5rpx; border-radius: 20rpx"> @@ -40,7 +35,8 @@ {{ item.source }} - {{ dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") }} + {{ + dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") }} {{ item.time }} @@ -50,24 +46,14 @@ -
- +
+
- + @@ -170,6 +156,16 @@ onMounted(async (e) => { } } + + // 解构路由参数,排除token + const { token, ...otherQuery } = route.query; + // 若存在token,替换路由清除参数 + if (token) { + router.replace({ + path: route.path, // 保持当前路径不变 + query: otherQuery, // 保留其他参数 + }); + } getNewsList(); }); diff --git a/src/utils/index.ts b/src/utils/index.ts index 5606919..0e96638 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -57,8 +57,9 @@ service.interceptors.response.use( financialAccount: Session.get("userPhone"), }); Session.clear(); // 清除浏览器全部临时缓存 - window.location.href = "/"; // 去登录页 - console.log("你已被登出,请重新登录"); + window.location.reload(); + // window.location.href = "/"; // 去登录页 + // console.log("你已被登出,请重新登录"); // ElMessageBox.alert('你已被登出,请重新登录', '提示', {}) // .then(() => {}) // .catch(() => {});