refactor(secondTop): 优化营期设置和结束逻辑

使用getRequestParams统一处理请求参数
将硬编码的字符串值改为变量引用
This commit is contained in:
2025-08-26 13:12:35 +08:00
parent d7c8a9e173
commit b7d46c3dde
3 changed files with 96 additions and 57 deletions

View File

@@ -381,7 +381,7 @@ const finishCamp = async () => {
try {
isCampFinished.value = true;
await CenterCampPeriodAdmin({
is_camp_finish: true
is_camp_finish: "11"
});
} catch (error) {
console.error('结束营期失败:', error);

View File

@@ -246,11 +246,9 @@ const centerData = ref({
// 保存营期
const saveCampSettings = async () => {
recalculateStageDates();
// 准备API请求参数
const params = {
user_name: userStore.userInfo.username,
user_level: userStore.userInfo.user_level.toString(),
...getRequestParams(),
receipt_data_time: dataReceivingStage.value.days.toString()
};
@@ -267,14 +265,13 @@ const centerData = ref({
alert('保存失败,请重试');
}
};
const padding111 = ref('11')
// 结束营期
const finishCamp = async () => {
try {
const params = {
user_name: userStore.userInfo.username,
user_level: userStore.userInfo.user_level.toString(),
is_camp_finish: "true"
...getRequestParams(),
is_camp_finish: padding111.value.toString()
};
const res = await getCampPeriodAdmin(params);