|
@@ -146,8 +146,8 @@ async function planJkesAutoRun(account, autoDayRaw, token, options = {}, d = new
|
|
|
const cfg = getJkesSettings()
|
|
const cfg = getJkesSettings()
|
|
|
const monthTargetKm = normalizeMonthTargetKm(options.monthTargetKm)
|
|
const monthTargetKm = normalizeMonthTargetKm(options.monthTargetKm)
|
|
|
const stopAfterMinimum = options.stopAfterMinimum !== false
|
|
const stopAfterMinimum = options.stopAfterMinimum !== false
|
|
|
- const maxAutoSingleKm = Math.max(2, Number(cfg.autoSingleRunMaxKm) || 5)
|
|
|
|
|
- const stepKm = Number(cfg.autoDistanceStepKm) || 0.5
|
|
|
|
|
|
|
+ const maxAutoSingleKm = Math.max(2, Number(cfg.autoSingleRunMaxKm) || 10)
|
|
|
|
|
+ const stepKm = Number(cfg.autoDistanceStepKm) || 0.1
|
|
|
|
|
|
|
|
const autoDays = parseAutoDay(autoDayRaw)
|
|
const autoDays = parseAutoDay(autoDayRaw)
|
|
|
const wd = d.getDay()
|
|
const wd = d.getDay()
|
|
@@ -184,12 +184,12 @@ async function planJkesAutoRun(account, autoDayRaw, token, options = {}, d = new
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 手动发起:不校验星期;单次 distanceKm 为 0.5–10。本月已跑里程不设上限(30km 仅为学校最低要求参考)。
|
|
|
|
|
|
|
+ * 手动发起:不校验星期;单次 distanceKm 为 1–10。本月已跑里程不设上限(30km 仅为学校最低要求参考)。
|
|
|
*/
|
|
*/
|
|
|
-async function planJkesManualRun(account, token, distanceKm = 0.5, d = new Date()) {
|
|
|
|
|
|
|
+async function planJkesManualRun(account, token, distanceKm = 1, d = new Date()) {
|
|
|
const kmReq = Number(distanceKm)
|
|
const kmReq = Number(distanceKm)
|
|
|
- if (!Number.isFinite(kmReq) || kmReq < 0.5 || kmReq > 10) {
|
|
|
|
|
- return { run: false, reason: '单次距离需在 0.5–10 公里' }
|
|
|
|
|
|
|
+ if (!Number.isFinite(kmReq) || kmReq < 1 || kmReq > 10) {
|
|
|
|
|
+ return { run: false, reason: '单次距离需在 1–10 公里' }
|
|
|
}
|
|
}
|
|
|
await refreshMonthKmFromApi(account, token, d)
|
|
await refreshMonthKmFromApi(account, token, d)
|
|
|
return { run: true, targetKm: Math.round(kmReq * 1000) / 1000 }
|
|
return { run: true, targetKm: Math.round(kmReq * 1000) / 1000 }
|