refactor(secondTop): 优化营期设置和结束逻辑
使用getRequestParams统一处理请求参数 将硬编码的字符串值改为变量引用
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user