From ab48b4d640f505495365f389346472d434f016dd Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 5 Jan 2024 09:21:52 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E8=AF=B7=E6=B1=82=EF=BC=9A?= =?UTF-8?q?=E5=B0=86=E8=87=AA=E5=B7=B1=E7=9A=84=E8=AF=B7=E6=B1=82=EF=BC=8C?= =?UTF-8?q?=E4=BB=8E=20request2=20=E4=B8=94=E5=88=B0=20request=20=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sheep/api/member/address.js | 12 ++++++------ sheep/api/promotion/combination.js | 14 +++++++------- sheep/api/system/area.js | 4 ++-- sheep/api/trade/afterSale.js | 9 ++++----- sheep/api/trade/cart.js | 13 ++++++------- sheep/api/trade/config.js | 3 +-- sheep/request/index.js | 4 ++-- 7 files changed, 28 insertions(+), 31 deletions(-) diff --git a/sheep/api/member/address.js b/sheep/api/member/address.js index d84643ec..72c67ad7 100644 --- a/sheep/api/member/address.js +++ b/sheep/api/member/address.js @@ -1,16 +1,16 @@ -import request2 from '@/sheep/request2'; +import request from '@/sheep/request'; const AddressApi = { // 获得用户收件地址列表 getAddressList: () => { - return request2({ + return request({ url: '/app-api/member/address/list', method: 'GET' }); }, // 创建用户收件地址 createAddress: (data) => { - return request2({ + return request({ url: '/app-api/member/address/create', method: 'POST', data @@ -18,7 +18,7 @@ const AddressApi = { }, // 更新用户收件地址 updateAddress: (data) => { - return request2({ + return request({ url: '/app-api/member/address/update', method: 'PUT', data @@ -26,7 +26,7 @@ const AddressApi = { }, // 获得用户收件地址 getAddress: (id) => { - return request2({ + return request({ url: '/app-api/member/address/get', method: 'GET', params: { id } @@ -34,7 +34,7 @@ const AddressApi = { }, // 删除用户收件地址 deleteAddress: (id) => { - return request2({ + return request({ url: '/app-api/member/address/delete', method: 'DELETE', params: { id } diff --git a/sheep/api/promotion/combination.js b/sheep/api/promotion/combination.js index eeeb9a0a..e3f42410 100644 --- a/sheep/api/promotion/combination.js +++ b/sheep/api/promotion/combination.js @@ -1,10 +1,10 @@ -import request2 from "@/sheep/request2"; +import request from "@/sheep/request"; // 拼团 API const CombinationApi = { // 获得拼团活动列表 getCombinationActivityList: (count) => { - return request2({ + return request({ url: "promotion/combination-activity/list", method: 'GET', params: {count} @@ -13,7 +13,7 @@ const CombinationApi = { // 获得拼团活动分页 getCombinationActivityPage: (params) => { - return request2({ + return request({ url: "promotion/combination-activity/page", method: 'GET', params @@ -22,7 +22,7 @@ const CombinationApi = { // 获得拼团活动明细 getCombinationActivity: (id) => { - return request2({ + return request({ url: "promotion/combination-activity/get-detail", method: 'GET', params: { @@ -33,7 +33,7 @@ const CombinationApi = { // 获得最近 n 条拼团记录(团长发起的) getHeadCombinationRecordList: (activityId, status, count) => { - return request2({ + return request({ url: "promotion/combination-record/get-head-list", method: 'GET', params: { @@ -46,7 +46,7 @@ const CombinationApi = { // 获得拼团记录明细 getCombinationRecordDetail: (id) => { - return request2({ + return request({ url: "promotion/combination-record/get-detail", method: 'GET', params: { @@ -57,7 +57,7 @@ const CombinationApi = { // 获得拼团记录的概要信息 getCombinationRecordSummary: () => { - return request2({ + return request({ url: "promotion/combination-record/get-summary", method: 'GET', }); diff --git a/sheep/api/system/area.js b/sheep/api/system/area.js index 2ef9f1ed..1d4fb0af 100644 --- a/sheep/api/system/area.js +++ b/sheep/api/system/area.js @@ -1,9 +1,9 @@ -import request2 from '@/sheep/request2'; +import request from '@/sheep/request'; const AreaApi = { // 获得地区树 getAreaTree: () => { - return request2({ + return request({ url: '/app-api/system/area/tree', method: 'GET' }); diff --git a/sheep/api/trade/afterSale.js b/sheep/api/trade/afterSale.js index e5488dcc..bbf1aa8c 100644 --- a/sheep/api/trade/afterSale.js +++ b/sheep/api/trade/afterSale.js @@ -1,10 +1,9 @@ -import request2 from '@/sheep/request2'; import request from '@/sheep/request'; const AfterSaleApi = { // 创建售后 createAfterSale: (data) => { - return request2({ + return request({ url: `/app-api/trade/after-sale/create`, method: 'POST', data, @@ -12,7 +11,7 @@ const AfterSaleApi = { }, // 获得售后 getAfterSale: (id) => { - return request2({ + return request({ url: `/app-api/trade/after-sale/get`, method: 'GET', params: { @@ -22,7 +21,7 @@ const AfterSaleApi = { }, // 取消售后 cancelAfterSale: (id) => { - return request2({ + return request({ url: `/app-api/trade/after-sale/cancel`, method: 'DELETE', params: { @@ -32,7 +31,7 @@ const AfterSaleApi = { }, // 获得售后日志列表 getAfterSaleLogList: (afterSaleId) => { - return request2({ + return request({ url: `/app-api/trade/after-sale-log/list`, method: 'GET', params: { diff --git a/sheep/api/trade/cart.js b/sheep/api/trade/cart.js index f6a0104a..55f55b48 100644 --- a/sheep/api/trade/cart.js +++ b/sheep/api/trade/cart.js @@ -1,12 +1,11 @@ -import request2 from '@/sheep/request2'; +import request from '@/sheep/request'; const CartApi = { addCart: (data) => { - return request2({ + return request({ url: '/app-api/trade/cart/add', method: 'POST', data: data, - // TODO 芋艿:这里没提示 custom: { showSuccess: true, successMsg: '已添加到购物车~', @@ -14,21 +13,21 @@ const CartApi = { }); }, updateCartCount: (data) => { - return request2({ + return request({ url: '/app-api/trade/cart/update-count', method: 'PUT', data: data }); }, updateCartSelected: (data) => { - return request2({ + return request({ url: '/app-api/trade/cart/update-selected', method: 'PUT', data: data }); }, deleteCart: (ids) => { - return request2({ + return request({ url: '/app-api/trade/cart/delete', method: 'DELETE', params: { @@ -37,7 +36,7 @@ const CartApi = { }); }, getCartList: () => { - return request2({ + return request({ url: '/app-api/trade/cart/list', method: 'GET', }); diff --git a/sheep/api/trade/config.js b/sheep/api/trade/config.js index f397dd44..4af729fb 100644 --- a/sheep/api/trade/config.js +++ b/sheep/api/trade/config.js @@ -1,10 +1,9 @@ -import request2 from '@/sheep/request2'; import request from '@/sheep/request'; const TradeConfigApi = { // 获得交易配置 getTradeConfig: () => { - return request2({ + return request({ url: `/app-api/trade/config/get`, method: 'GET', }); diff --git a/sheep/request/index.js b/sheep/request/index.js index f350792e..7cc1c482 100644 --- a/sheep/request/index.js +++ b/sheep/request/index.js @@ -130,8 +130,8 @@ http.interceptors.response.use( (response.data.msg !== '' || response.config.custom.successMsg !== '') && response.config.custom.showSuccess ) { - uni.showToast({ - title: response.config.custom.successMsg || response.data.msg, + uni.showToast({ + title: response.config.custom.successMsg, icon: 'none', }); }