From 1ad4cd034ae1cee3eec3a1886a7dfd6fcbb3631c Mon Sep 17 00:00:00 2001 From: eafonyang Date: Thu, 11 Jun 2026 11:12:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/services/curveClient.js | 6 +++--- scripts/upload.sh | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/services/curveClient.js b/backend/src/services/curveClient.js index 93e75b1..11fd256 100644 --- a/backend/src/services/curveClient.js +++ b/backend/src/services/curveClient.js @@ -84,10 +84,10 @@ async function fetchAndValidateCurve(brand, name, form, timeout = 20000) { if (!brand || !name) return [false, '品牌名称或型号名称为空']; const target = curveTargetForForm(form); - if (!target) return [false, '佩戴方式须为入耳式(in-ear)或头戴式(over-ear)才能校验曲线']; + if (!target) return [false, '佩戴方式须为入耳式(in-ear)或头戴式(over-ear)才能校验曲线!']; - const params = new URLSearchParams({ brand, name, target }); - const url = `${LUXSIN_CURVE_API_BASE}?${params.toString()}`; + const qs = `brand=${encodeURIComponent(brand)}&name=${encodeURIComponent(name)}&target=${encodeURIComponent(target)}`; + const url = `${LUXSIN_CURVE_API_BASE}?${qs}`; logger.info(`getCurve request: brand=${brand}, name=${name}, form=${form}, target=${target}, url=${url}`); diff --git a/scripts/upload.sh b/scripts/upload.sh index fe356c2..08042e2 100755 --- a/scripts/upload.sh +++ b/scripts/upload.sh @@ -102,6 +102,8 @@ upload_path() { if [[ -d "$local_full" ]]; then info "上传目录: ${rel_path}/ → ${SERVER}:${remote_path}/" + # 先删除远程同名目录,避免 scp 将目录嵌套到已有目录内 + ssh $SSH_OPTS "$SERVER" "rm -rf '${remote_path}'" scp $SCP_OPTS -r "$local_full" "${SERVER}:${remote_path}" else info "上传文件: ${rel_path} → ${SERVER}:${remote_path}"