79 lines
2.0 KiB
TypeScript
79 lines
2.0 KiB
TypeScript
const baseUrl = require("../base").allBaseUrl.GDEnvs.host;
|
||
import { httpRequest } from "../../utils/request";
|
||
import { wxInfo, mpInfo, miniProgramVersion } from "../../utils/getUserInfo";
|
||
|
||
// 获取首页数据
|
||
export const apiGetHome = (data: any) => {
|
||
return httpRequest.post<any>(`${baseUrl}/api-interface/app/index/page/list`, {
|
||
frontPage: 1,
|
||
...data,
|
||
});
|
||
};
|
||
|
||
// 获取商品列表数据
|
||
export const apiGetCommodityList = (data: any) => {
|
||
return httpRequest.post<any>(`${baseUrl}/api-interface/app/index/page/list`, {
|
||
...data,
|
||
});
|
||
};
|
||
|
||
// 获取购物车列表数据
|
||
export const apiGetCartList = (data: any) => {
|
||
return httpRequest.post<any>(
|
||
`${baseUrl}/api-interface/app/shipping/cart/list`,
|
||
{
|
||
...data,
|
||
}
|
||
);
|
||
};
|
||
|
||
// 获取首页数据
|
||
export const apiGetAppCategoryList = () => {
|
||
return httpRequest.post<any>(
|
||
`${baseUrl}/api-interface/app/category/list`,
|
||
{}
|
||
);
|
||
};
|
||
|
||
// 去借款
|
||
export const apiGoBorrow = (data: any) => {
|
||
return httpRequest.post<any>(
|
||
`${baseUrl}/lt-web/xs/xcx/common/wxUser/goBorrow`,
|
||
data
|
||
);
|
||
};
|
||
|
||
// 查询多账号用户列表
|
||
export const apiActIsMulPhones = (data: any) => {
|
||
return httpRequest.post<any>(
|
||
`${baseUrl}/lt-web/xs/app/act/isMulPhones`,
|
||
data
|
||
);
|
||
};
|
||
|
||
// 确认切换账号为主号
|
||
export const apiActChangeAccount = (data: any) => {
|
||
return httpRequest.post<any>(
|
||
`${baseUrl}/lt-web/xs/app/act/changeAccount`,
|
||
data
|
||
);
|
||
};
|
||
|
||
// 排查问题log
|
||
export const apiProblemLog = (data: object) => {
|
||
try {
|
||
const user_info = wx.getStorageSync("user_info");
|
||
if (user_info.phone) {
|
||
Object.assign(data, { userName: user_info.phone });
|
||
}
|
||
Object.assign(data, {
|
||
osVersion: wxInfo.version, // 操作系统版本
|
||
opt: mpInfo.miniProgram.envVersion, // 操作
|
||
appVersion: miniProgramVersion, // app版本
|
||
});
|
||
} catch (e) {
|
||
console.log("获取首页接口catch:", e);
|
||
}
|
||
return httpRequest.post(`${baseUrl}/lt-web/xs/user/front/problem`, data);
|
||
};
|