请求:将自己的请求,从 request2 且到 request 中

pull/36/MERGE
YunaiV 2024-01-05 09:21:52 +08:00
parent 2600716d46
commit ab48b4d640
7 changed files with 28 additions and 31 deletions

View File

@ -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 }

View File

@ -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',
});

View File

@ -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'
});

View File

@ -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: {

View File

@ -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',
});

View File

@ -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',
});

View File

@ -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',
});
}