diff --git a/config/app.js b/config/app.js index d0d2d85..840fb8a 100644 --- a/config/app.js +++ b/config/app.js @@ -1,9 +1,9 @@ let BASE_URL import store from "@/store/user.js" // 环境 -let env = "dev" +// let env = "dev" // let env = "test" -// let env = "prod" +let env = "prod" // let env = "local" switch (env) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 2612d4c..9082f0f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -24,7 +24,7 @@ - + @@ -311,6 +311,7 @@ page_size: 30 }).then(res => { if (pid == 0) { // 加载一级分类时设置全部分类 + if(!res.data?.lists?.length) return ; res.data?.lists?.unshift({ id: "", name: "全部", @@ -336,7 +337,7 @@ return item; }) // 给所有子级分配 - goodClassList.value = res.data?.lists || []; + goodClassList.value = [...goodClassList.value, ...res.data?.lists]; goodClassTow.value = goodClassList.value[0]?.children || []; goodClassThree.value = goodClassTow.value[0]?.children || []; topActive.value = goodClassList.value[0]?.id; @@ -426,7 +427,7 @@ } onLoad(() => { - getgoodClassList(); + getgoodClassList(0); getGoodList(); })