fix: 修复用户参数初始化及存储问题
将userParams的初始化提前到组件加载时,确保在onLoad中能正确存储token。同时移除重复的userParams赋值逻辑。
This commit is contained in:
parent
90e01e8009
commit
cae58ccd3f
|
|
@ -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 () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue