From 1d1bbae0c5cd95d9f24a98d2fc5e0118a668a59d Mon Sep 17 00:00:00 2001 From: "34701892@qq.com" <34701892@qq.com> Date: Tue, 23 Dec 2025 09:17:51 +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=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=94=A8=E6=88=B7=E7=B1=BB=E5=9E=8B=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改config中的baseUrl为生产环境地址 在indexNewsInfo.vue中添加用户类型判断,仅经理用户可显示评论功能 调整token刷新逻辑,仅对普通用户生效 --- src/config/index.ts | 4 ++-- src/pages/detail/indexNewsInfo.vue | 27 ++++++++++++++++++--------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/config/index.ts b/src/config/index.ts index e967188..9abcbdb 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -1,7 +1,7 @@ // const baseUrl = "http://192.168.31.25:8060/api"; -export const baseUrl = "http://127.0.0.1:8040/apih5"; +// export const baseUrl = "http://127.0.0.1:8040/apih5"; // export const baseUrl = "http://123.60.153.169:8042/apih5"; -// export const baseUrl = "https://cankao.cs.com.cn/mini"; +export const baseUrl = "https://cankao.cs.com.cn/mini"; export const baseUrlDataV = "https://cankao.cs.com.cn/zzck_datav"; // export const baseUrlDataV = "http://123.60.153.169:9995/zzck_datav"; diff --git a/src/pages/detail/indexNewsInfo.vue b/src/pages/detail/indexNewsInfo.vue index 8b8ef1a..b023aff 100644 --- a/src/pages/detail/indexNewsInfo.vue +++ b/src/pages/detail/indexNewsInfo.vue @@ -47,7 +47,7 @@ { console.log("🚀 ~ onReachBottom ~ onReachBottom:"); }); +// 1:经理用户、2:普通用户 +const userType = ref(2); const isDomestic = ref(false); onLoad(async (option: any) => { uni.pageScrollTo({ @@ -135,14 +137,21 @@ onLoad(async (option: any) => { window.location.reload(); } - console.log("🚀 ~ Date.now():", Date.now()); - // 打开页面时链接中带有time字段,表示上次分享的时间 - let shareTime = option?.time || 0; - // 现在的时间对比上次的分享时间,如果超过24小时,则刷新推荐栏目 - if (uni.getStorageSync("token") && Date.now() - shareTime > 24 * 60 * 60 * 1000) { - uni.removeStorageSync("token"); - // 1766373354519 - window.location.reload(); + // 1:经理用户、2:普通用户 + if (option?.userType) { + userType.value = option.userType; + } + + if (option?.userType == 2) { + console.log("🚀 ~ Date.now():", Date.now()); + // 打开页面时链接中带有time字段,表示上次分享的时间 + let shareTime = option?.time || 0; + // 现在的时间对比上次的分享时间,如果超过24小时,则刷新推荐栏目 + if (uni.getStorageSync("token") && Date.now() - shareTime > 24 * 60 * 60 * 1000) { + uni.removeStorageSync("token"); + // 1766373354519 + window.location.reload(); + } } });