From cae58ccd3f3309d2d160278bb0050bbd87d1fb99 Mon Sep 17 00:00:00 2001 From: "34701892@qq.com" <34701892@qq.com> Date: Thu, 15 Jan 2026 09:27:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=88=9D=E5=A7=8B=E5=8C=96=E5=8F=8A=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将userParams的初始化提前到组件加载时,确保在onLoad中能正确存储token。同时移除重复的userParams赋值逻辑。 --- src/pages/sreachReq/index.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/sreachReq/index.vue b/src/pages/sreachReq/index.vue index 090d365..4cbdf02 100644 --- a/src/pages/sreachReq/index.vue +++ b/src/pages/sreachReq/index.vue @@ -197,6 +197,7 @@ const handleSwiperJump = (item: any) => { userParams.value.userType + "&type=" + item.type; + console.log("🚀 ~ handleSwiperJump ~ shareUrl:", shareUrl); wx.miniProgram.navigateTo({ url: "/pages/webView/index?url=" + encodeURIComponent(shareUrl), success: (res) => { @@ -214,7 +215,7 @@ const handleChange = (val: string) => { inputValue.value = ""; } }; - +const userParams = ref({}); const keyWord = ref(); onLoad((e) => { if (e?.keyWord) { @@ -224,17 +225,16 @@ onLoad((e) => { screenList.value = []; // articleList.value.push(...searchList); handleChange(keyWord.value); -}); -const userParams = ref({}); -const onload = (option) => { - page.value++; - getData(); - - userParams.value = option; + userParams.value = e; if (userParams.value.phone) { uni.setStorageSync("token", userParams.value.phone); } +}); + +const onload = (option) => { + page.value++; + getData(); }; const getData = async () => {