添加api文件

This commit is contained in:
kron
2025-05-10 22:25:06 +08:00
parent 11c373f13e
commit aff7a2d3f6
2 changed files with 39 additions and 1 deletions

21
src/apis.js Normal file
View File

@@ -0,0 +1,21 @@
const BASE_URL = "http://120.79.241.5:8000/api/shoot/index";
// 获取全局配置
export const getAppConfig = () => {
return new Promise((resolve, reject) => {
uni.request({
url: `${BASE_URL}/appConfig`,
method: "GET",
success: (res) => {
resolve(res.data);
},
fail: (err) => {
reject(err);
uni.showToast({
title: "获取配置失败",
icon: "none",
});
},
});
});
};