feat: 增加获取商品详情

This commit is contained in:
zhangds 2024-05-30 18:34:31 +08:00
parent af428323e1
commit 48db1232af
1 changed files with 14 additions and 6 deletions

View File

@ -126,12 +126,6 @@
}, 1500); }, 1500);
}; };
// 获取商品列表
const getGoodsList = () => {
}
// 获取用户信息 // 获取用户信息
const getUserInfo = () => { const getUserInfo = () => {
try { try {
@ -148,7 +142,19 @@
} catch (err) { } catch (err) {
console.log("err =>", err); console.log("err =>", err);
} }
}
// 获取商品列表
const getGoodsList = () => {
try {
req.axiosGet("/front/homeData", {
token: state.token
}).then(res => {
console.log("goods =>", res)
})
} catch (err) {
console.log("err =>", err);
}
} }
onMounted(() => { onMounted(() => {
@ -160,8 +166,10 @@
localStorage.setItem("yl_token", token); localStorage.setItem("yl_token", token);
state.showPage = true; state.showPage = true;
getGoodsList();
return return
getUserInfo(); getUserInfo();
} else { } else {
openToast("未登录"); openToast("未登录");
} }