From e67ea56651c8106dc0cad023830eb38599a8d13e Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Mon, 13 Jul 2026 14:30:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=20API=20?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=B7=AF=E5=BE=84=E4=B8=8E=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/public/config.js | 6 -- buyer/src/api/address.js | 4 +- buyer/src/api/common.js | 16 ++-- buyer/src/api/goods.js | 4 +- buyer/src/components/verify/verify.js | 6 +- buyer/src/pages/home/memberCenter/Profile.vue | 4 +- .../home/memberCenter/evaluation/AddEval.vue | 4 +- .../pages/home/orderCenter/ApplyAfterSale.vue | 4 +- buyer/src/pages/home/orderCenter/Complain.vue | 4 +- buyer/src/pages/shopEntry/FirstApply.vue | 4 +- buyer/src/pages/shopEntry/ThirdApply.vue | 4 +- buyer/src/plugins/request.js | 12 --- buyer/src/utils/theme.js | 2 +- im/.env | 2 +- im/.env.development | 2 +- manager/public/config.js | 6 -- manager/src/api/common.js | 12 +-- manager/src/api/index.js | 45 +++-------- manager/src/components/verify/verify.js | 6 +- manager/src/libs/axios.js | 11 +-- .../src/views/sys/oss-manage/ossManage.vue | 8 +- .../setting-manage/setting/GOODS_SETTING.vue | 77 +------------------ seller/public/config.js | 8 +- seller/src/api/common.js | 12 +-- seller/src/api/goods.js | 1 - seller/src/api/index.js | 26 +++---- seller/src/libs/axios.js | 13 ++-- .../src/views/my-components/verify/verify.js | 6 +- seller/src/views/shop/ossManage.vue | 6 +- 29 files changed, 88 insertions(+), 227 deletions(-) diff --git a/buyer/public/config.js b/buyer/public/config.js index 2272ff76..593ec1d4 100644 --- a/buyer/public/config.js +++ b/buyer/public/config.js @@ -3,15 +3,9 @@ var BASE = { * @description api请求基础路径 */ API_DEV: { - common: "https://common-api.pickmall.cn", buyer: "https://buyer-api.pickmall.cn", - seller: "https://store-api.pickmall.cn", - manager: "https://admin-api.pickmall.cn" }, API_PROD: { - common: "https://common-api.pickmall.cn", buyer: "https://buyer-api.pickmall.cn", - seller: "https://store-api.pickmall.cn", - manager: "https://admin-api.pickmall.cn" }, }; diff --git a/buyer/src/api/address.js b/buyer/src/api/address.js index a522bc32..dadbcb27 100644 --- a/buyer/src/api/address.js +++ b/buyer/src/api/address.js @@ -1,5 +1,5 @@ import request, { - Method, commonUrl + Method, buyerUrl } from '@/plugins/request.js'; // 会员收货地址列表 @@ -55,7 +55,7 @@ export function getAddrDetail (id) { // 传给后台citycode 获取城市街道等id export function handleRegion (params) { return request({ - url: `${commonUrl}/common/common/region/region`, + url: `${buyerUrl}/buyer/common/region/region`, needToken: true, method: Method.GET, params diff --git a/buyer/src/api/common.js b/buyer/src/api/common.js index db827304..92f6d924 100644 --- a/buyer/src/api/common.js +++ b/buyer/src/api/common.js @@ -1,11 +1,11 @@ -import request, {Method, commonUrl} from '@/plugins/request.js'; +import request, {Method, buyerUrl} from '@/plugins/request.js'; /** * 获取拼图验证 */ export function getVerifyImg (verificationEnums) { return request({ - url: `${commonUrl}/common/common/slider/${verificationEnums}`, + url: `${buyerUrl}/buyer/common/slider/${verificationEnums}`, method: Method.GET, needToken: false }); @@ -15,7 +15,7 @@ export function getVerifyImg (verificationEnums) { */ export function postVerifyImg (params) { return request({ - url: `${commonUrl}/common/common/slider/${params.verificationEnums}`, + url: `${buyerUrl}/buyer/common/slider/${params.verificationEnums}`, method: Method.POST, needToken: false, params @@ -26,7 +26,7 @@ export function postVerifyImg (params) { */ export function sendSms (params) { return request({ - url: `${commonUrl}/common/common/sms/${params.verificationEnums}/${params.mobile}`, + url: `${buyerUrl}/buyer/common/sms/${params.verificationEnums}/${params.mobile}`, method: Method.GET, needToken: false, params @@ -36,7 +36,7 @@ export function sendSms (params) { // 地区数据,用于三级联动 export function getRegion (id) { return request({ - url: `${commonUrl}/common/common/region/item/${id}`, + url: `${buyerUrl}/buyer/common/region/item/${id}`, needToken: true, method: Method.GET, loading: false @@ -80,7 +80,7 @@ export function articleDetail (id) { // 获取IM接口前缀 export function getIMDetail () { return request({ - url: `${commonUrl}/common/common/IM`, + url: `${buyerUrl}/buyer/common/IM`, method: Method.GET }); } @@ -89,7 +89,7 @@ export function getIMDetail () { //获取图片logo export function getBaseSite(){ return request ({ - url:`${commonUrl}/common/common/site`, + url:`${buyerUrl}/buyer/common/site`, method: Method.GET, needToken: false }) @@ -98,7 +98,7 @@ export function getBaseSite(){ // 获取主题色配置 export function getThemeSetting() { return request({ - url: `${commonUrl}/common/common/site/theme`, + url: `${buyerUrl}/buyer/common/site/theme`, method: Method.GET, needToken: false, }); diff --git a/buyer/src/api/goods.js b/buyer/src/api/goods.js index 89dbd28f..76fe0d03 100644 --- a/buyer/src/api/goods.js +++ b/buyer/src/api/goods.js @@ -5,7 +5,7 @@ import request, { // 商品列表 export function goodsList (params) { return request({ - url: '/buyer/goods/goods/es', + url: '/buyer/goods/goods/search', method: Method.GET, needToken: false, optionalToken: true, @@ -16,7 +16,7 @@ export function goodsList (params) { // 商品分类 筛选条件 品牌, 尺寸等 export function filterList (params) { return request({ - url: '/buyer/goods/goods/es/related', + url: '/buyer/goods/goods/search/related', method: Method.GET, needToken: false, optionalToken: true, diff --git a/buyer/src/components/verify/verify.js b/buyer/src/components/verify/verify.js index e6cda9f6..4cd73138 100644 --- a/buyer/src/components/verify/verify.js +++ b/buyer/src/components/verify/verify.js @@ -1,5 +1,5 @@ -import request, {Method, commonUrl} from '@/plugins/request.js'; +import request, {Method, buyerUrl} from '@/plugins/request.js'; import storage from '@/plugins/storage.js'; /** @@ -7,7 +7,7 @@ import storage from '@/plugins/storage.js'; */ export function getVerifyImg (verificationEnums) { return request({ - url: `${commonUrl}/common/common/slider/${verificationEnums}`, + url: `${buyerUrl}/buyer/common/slider/${verificationEnums}`, method: Method.GET, needToken: false, headers: {uuid: storage.getItem('uuid')} @@ -19,7 +19,7 @@ export function getVerifyImg (verificationEnums) { */ export function postVerifyImg (params) { return request({ - url: `${commonUrl}/common/common/slider/${params.verificationEnums}`, + url: `${buyerUrl}/buyer/common/slider/${params.verificationEnums}`, method: Method.POST, needToken: false, params, diff --git a/buyer/src/pages/home/memberCenter/Profile.vue b/buyer/src/pages/home/memberCenter/Profile.vue index 31029bf1..88c04cb0 100644 --- a/buyer/src/pages/home/memberCenter/Profile.vue +++ b/buyer/src/pages/home/memberCenter/Profile.vue @@ -46,7 +46,7 @@