From 620ab246b9598df968d7af3cdd552cdd638efd54 Mon Sep 17 00:00:00 2001 From: kron Date: Sat, 5 Jul 2025 18:51:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E6=8B=9F=E5=B0=84?= =?UTF-8?q?=E7=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis.js | 2 +- src/components/BowTarget.vue | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/apis.js b/src/apis.js index 742e84d..0880f70 100644 --- a/src/apis.js +++ b/src/apis.js @@ -201,7 +201,7 @@ export const simulShootAPI = (device_id, x, y) => { const data = { device_id, }; - if (x && y) { + if (x !== undefined && y !== undefined) { data.x = x; data.y = y; } diff --git a/src/components/BowTarget.vue b/src/components/BowTarget.vue index f3d07b9..40fc1ff 100644 --- a/src/components/BowTarget.vue +++ b/src/components/BowTarget.vue @@ -111,6 +111,9 @@ function calcRealY(num) { const simulShoot = async () => { if (device.value.deviceId) await simulShootAPI(device.value.deviceId); }; +const simulShoot2 = async () => { + if (device.value.deviceId) await simulShootAPI(device.value.deviceId, 1, 1); +};