From fbea363bb80afea8320e82615d712c73f6f5db44 Mon Sep 17 00:00:00 2001 From: "34701892@qq.com" <34701892@qq.com> Date: Mon, 5 Jan 2026 16:48:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE=E5=92=8C?= =?UTF-8?q?UI=E6=96=87=E6=9C=AC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将RankListMini中的分享链接改为本地开发环境 - 添加userType值的alert调试 - 修改minihome页面的"海外资讯"为"海外精选" - 移除requestClass中的调试日志和优化GET请求处理 --- src/components/RankListMini.vue | 6 ++++-- src/pages/minihome/index.vue | 3 +-- src/utils/requestClass.ts | 7 ++----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/RankListMini.vue b/src/components/RankListMini.vue index d5bcb39..b4734de 100644 --- a/src/components/RankListMini.vue +++ b/src/components/RankListMini.vue @@ -161,14 +161,16 @@ function goDetail(item) { // if (judgeRuntimeEnv().isWxMiniWebview) { let shareUrl = - "https://cankao.cs.com.cn/jnh/#/pages/detail/indexNewsInfo?id=" + - // "http://localhost:8881/jnh/#/pages/detail/indexNewsInfo?id=" + + // "https://cankao.cs.com.cn/jnh/#/pages/detail/indexNewsInfo?id=" + + "http://localhost:8881/jnh/#/pages/detail/indexNewsInfo?id=" + item.news_id + "&phone=" + uni.getStorageSync("token") + "&userType=" + userType.value; + alert(userType.value); + wx.miniProgram.navigateTo({ url: "/pages/webView/index?url=" + encodeURIComponent(shareUrl), success: (res) => { diff --git a/src/pages/minihome/index.vue b/src/pages/minihome/index.vue index fdd1474..8662083 100644 --- a/src/pages/minihome/index.vue +++ b/src/pages/minihome/index.vue @@ -62,7 +62,7 @@ - 海外资讯 + 海外精选 @@ -181,7 +181,6 @@ onShow(() => { const userParams = ref({}); onLoad((option) => { - console.log("🚀 ~ option:", option); userParams.value = option; if (userParams.value.phone) { uni.setStorageSync("token", userParams.value.phone); diff --git a/src/utils/requestClass.ts b/src/utils/requestClass.ts index 0a5abf7..fea2db1 100644 --- a/src/utils/requestClass.ts +++ b/src/utils/requestClass.ts @@ -21,7 +21,6 @@ class requestClass { // 拦截器 interceptors = { request: (func: Fn) => { - console.log("🚀 ~ requestClass ~ func:", func) if (func) { requestClass[requestBefore] = func; } else { @@ -53,12 +52,10 @@ class requestClass { request(options: UniApp.RequestOptions & { baseURL?: string }) { options.baseURL = options.baseURL || this[config].baseURL; options.dataType = options.dataType || this[config].dataType; - options.url = requestClass[isCompleteURL](options.url) - ? options.url - : options.baseURL + options.url; + options.url = requestClass[isCompleteURL](options.url) ? options.url : options.baseURL + options.url; // 新增:如果是GET请求且data为空对象,则删除data - if (options.method === 'GET' && options.data && Object.keys(options.data).length === 0) { + if (options.method === "GET" && options.data && Object.keys(options.data).length === 0) { delete options.data; } else { options.data = options.data;