Просмотр исходного кода

fix(shop): add missing goodsCategory API to fix empty product list on shop index page

asus 1 месяц назад
Родитель
Сommit
9c7a7495ca
2 измененных файлов с 11 добавлено и 6 удалено
  1. 6 6
      cfc-frontend/config.js
  2. 5 0
      cfc-frontend/utils/api.js

+ 6 - 6
cfc-frontend/config.js

@@ -28,18 +28,18 @@ try {
     switch (env) {
       case 'develop':
         API_BASE_URL = 'https://cfc.etotem.com.cn'
-        LANGGRAPH_BASE_URL = 'http://cfc.etotem.com.cn:9000'
-        DIFY_BASE_URL = 'http://cfc.etotem.com.cn:8083'
+        LANGGRAPH_BASE_URL = 'http://ai.etotem.com.cn'
+        DIFY_BASE_URL = 'http://cfc.etotem.com.cn'
         break
       case 'trial':
         API_BASE_URL = 'https://cfc.iwintrue.com'
-        LANGGRAPH_BASE_URL = 'https://cfc.iwintrue.com:9000'
-        DIFY_BASE_URL = 'https://cfc.iwintrue.com:8083'
+        LANGGRAPH_BASE_URL = 'https://ai.iwintrue.com'
+        DIFY_BASE_URL = 'https://cfc.iwintrue.com'
         break
       case 'release':
         API_BASE_URL = 'https://cfc.etotem.com.cn'
-        LANGGRAPH_BASE_URL = 'https://cfc.etotem.com.cn:9000'
-        DIFY_BASE_URL = 'https://cfc.etotem.com.cn:8083'
+        LANGGRAPH_BASE_URL = 'https://ai.etotem.com.cn'
+        DIFY_BASE_URL = 'https://cfc.etotem.com.cn'
         break
     }
   }

+ 5 - 0
cfc-frontend/utils/api.js

@@ -1339,6 +1339,11 @@ export const getPublicConfig = (key) => {
 
 // ===================== 幸福邻里部落 - 商品系统 =====================
 
+// 商品分类树(公开)— pages/shop/index 依赖此函数加载分类,缺失会导致 onLoad 中断
+export const goodsCategory = () => {
+  return request('/api/shop/category/tree', 'POST', {})
+}
+
 // 商品列表(公开)
 export const productList = (params) => {
   return request('/api/product/list', 'POST', params)