update:对接个人训练改版

This commit is contained in:
2026-07-23 09:44:58 +08:00
parent a78ab1daeb
commit 3c5754b3fd
64 changed files with 1769 additions and 488 deletions
+6 -10
View File
@@ -8,7 +8,7 @@ try {
switch (envVersion) {
case "develop": // 开发版
// BASE_URL = "http://192.168.1.2:8000/api/shoot";
// BASE_URL = "http://192.168.1.5:8000/api/shoot";
BASE_URL = "https://apitest.shelingxingqiu.com/api/shoot";
break;
case "trial": // 体验版
@@ -26,8 +26,6 @@ try {
}
const ADDONS_BASE_URL = BASE_URL.replace(/\/api\/shoot$/, "/api/shoot");
const PRACTICE_BASE_URL = BASE_URL.replace(/\/api\/shoot$/, "/api");
// 统一处理业务接口请求,包含登录态、业务错误和 WiFi 连接空响应兼容。
function request(method, url, data = {}, baseUrl = BASE_URL) {
const token = uni.getStorageSync(
@@ -264,13 +262,11 @@ export const createPractiseAPI = (arrows, time, target) => {
});
};
export const createPractiseV2API = (arrows, time, target, deviceId) => {
return request("POST", "/practice/create-v2", {
shootNumber: arrows,
shootTime: time,
targetType: Number(target || 1) * 20,
deviceId,
}, PRACTICE_BASE_URL);
export const createPractiseV2API = (trainingType, difficultyLevel) => {
return request("POST", "/user/practice/create/v2", {
trainingType,
difficultyLevel,
});
};
export const startPractiseAPI = (id) => {