2025-10-26 16:26:56 +08:00

69 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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