代码删除

This commit is contained in:
qiuyuan 2025-12-04 14:42:33 +08:00
parent e4daef774b
commit 4db5488f90

View File

@ -130,10 +130,7 @@ const onChange = (current: number) => {
// //
const fetchBannerList = async () => { const fetchBannerList = async () => {
try { try {
console.log('开始请求轮播图数据...');
const res: any = await getBannerList(); const res: any = await getBannerList();
console.log('API返回数据:', res);
// //
if (res && Array.isArray(res) && res.length > 0) { if (res && Array.isArray(res) && res.length > 0) {
const processedList = res.map((item: any, index: number) => { const processedList = res.map((item: any, index: number) => {
@ -152,10 +149,8 @@ const fetchBannerList = async () => {
}); });
bannerList.value = processedList; bannerList.value = processedList;
console.log('处理后的轮播图数据:', bannerList.value);
} else { } else {
// API使 // API使
console.log('API返回无效数据使用默认图片');
bannerList.value = [{ id: 0, image_url: defaultBanner }]; bannerList.value = [{ id: 0, image_url: defaultBanner }];
} }
} catch (error: any) { } catch (error: any) {
@ -169,9 +164,7 @@ const fetchBannerList = async () => {
const getGPUList = async () => { const getGPUList = async () => {
try { try {
const res: any = await getGpuList(); const res: any = await getGpuList();
console.log('数据内容:', JSON.stringify(res, null, 2));
source.value = res; source.value = res;
console.log('GPU列表请求成功:', res);
} catch (error: any) { } catch (error: any) {
console.error('GPU列表请求失败:', error); console.error('GPU列表请求失败:', error);
@ -203,22 +196,12 @@ const getAdvantageList = async () => {
} }
} }
//
const getHotProductList = async () => {
try {
const res = await getHotProduct();
console.log('热门产品请求成功:', res);
} catch (error: any) { //
console.error('热门产品请求失败:', error);
}
}
fetchBannerList(); fetchBannerList();
getGPUList(); getGPUList();
getAdvantageList(); getAdvantageList();
// getHotProductList();
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">