分销商品列表-分销账户信息

This commit is contained in:
落日晚风
2023-12-18 17:58:00 +08:00
parent 4cb256af6c
commit 4a487b5894
9 changed files with 801 additions and 771 deletions
+68 -62
View File
@@ -1,65 +1,71 @@
import request from '@/sheep/request';
export default {
// 分销商详情
agent: () =>
request({
url: 'commission/agent',
method: 'GET',
custom: {
showLoading: false,
showError: false,
},
}),
// 分销表单
form: () =>
request({
url: 'commission/agent/form',
method: 'GET',
}),
// 申请分销商
apply: (data) =>
request({
url: 'commission/agent/apply',
method: 'POST',
data,
custom: {
showSuccess: true,
},
}),
// 分销动态
log: (params) =>
request({
url: 'commission/log',
method: 'GET',
params,
}),
// 分销订单
order: (params) =>
request({
url: 'commission/order',
method: 'GET',
params,
}),
// 分销商品
goods: (params) =>
request({
url: 'commission/goods',
method: 'GET',
params,
}),
// 我的团队
team: (params) =>
request({
url: 'commission/agent/team',
method: 'GET',
params,
}),
// 佣金转余额
transfer: (data) =>
request({
url: 'commission/agent/transfer',
method: 'POST',
data,
}),
};
// 分销商详情
agent: () =>
request({
url: 'commission/agent',
method: 'GET',
custom: {
showLoading: false,
showError: false,
},
}),
// 分销表单
form: () =>
request({
url: 'commission/agent/form',
method: 'GET',
}),
// 申请分销商
apply: (data) =>
request({
url: 'commission/agent/apply',
method: 'POST',
data,
custom: {
showSuccess: true,
},
}),
// 分销动态
log: (params) =>
request({
url: 'commission/log',
method: 'GET',
params,
}),
// 分销订单
order: (params) =>
request({
url: 'commission/order',
method: 'GET',
params,
}),
// 分销商品
goods: (params) =>
request({
url: '/app-api/product/spu/page',
method: 'GET',
params,
}),
// 我的团队
team: (params) =>
request({
url: 'commission/agent/team',
method: 'GET',
params,
}),
// 佣金转余额
transfer: (data) =>
request({
url: 'commission/agent/transfer',
method: 'POST',
data,
}),
getSummary: (data) =>
request({
url: '/app-api/trade/brokerage-user/get-summary',
method: 'GET',
}),
};
+6 -6
View File
@@ -94,7 +94,7 @@ http.interceptors.request.use(
if (config.url.indexOf('/app-api/') !== -1) {
config.header['Accept'] = '*/*'
config.header['tenant-id'] = '1';
config.header['terminal'] = '20';
config.header['terminal'] = '20';
config.header['Authorization'] = 'Bearer test247';
}
return config;
@@ -113,7 +113,7 @@ http.interceptors.response.use(
if (response.header.authorization || response.header.Authorization) {
$store('user').setToken(response.header.authorization || response.header.Authorization);
}
// TODO 芋艿:如果是登录的 API,则自动设置 token
// TODO 芋艿:如果是登录的 API,则自动设置 token
response.config.custom.showLoading && closeLoading();
if (response.data.error !== 0 && response.data.code !== 0) {
@@ -125,10 +125,10 @@ http.interceptors.response.use(
});
return Promise.resolve(response.data);
}
// 成功时的提示
// 成功时的提示
if (
(response.data.error === 0 || response.data.code === 0) &&
( response.data.msg !== '' || response.config.custom.successMsg !== '' ) &&
(response.data.msg !== '' || response.config.custom.successMsg !== '') &&
response.config.custom.showSuccess
) {
uni.showToast({
@@ -215,8 +215,8 @@ const request = (config) => {
}
// TODO 芋艿:额外拼接
if (config.url.indexOf('/app-api/') >= 0) {
// config.url = 'http://api-dashboard.yudao.iocoder.cn' + config.url; // 调用【云端】
config.url = 'http://127.0.0.1:48080' + config.url; // 调用【本地】
config.url = 'http://api-dashboard.yudao.iocoder.cn' + config.url; // 调用【云端】
// config.url = 'http://127.0.0.1:48080' + config.url; // 调用【本地】
}
return http.middleware(config);
};
+2 -2
View File
@@ -95,8 +95,8 @@ http.interceptors.request.use(
if (config.url.indexOf('/app-api/') !== -1) {
config.header['Accept'] = '*/*'
config.header['tenant-id'] = '1';
config.header['terminal'] = '20';
config.header['Authorization'] = 'Bearer test247';
config.header['terminal'] = '20';
config.header['Authorization'] = 'Bearer test247';
}
return config;
},