From 10e27c009640d48c4f89c8ee8335b3964a0d5ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=83=9C=ED=9B=88?= Date: Mon, 29 Jun 2026 15:39:25 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=AA=A8=EB=B0=94=EC=9D=BC=20=EC=9D=B8?= =?UTF-8?q?=EC=95=B1=20=EC=8A=A4=EC=BA=90=EB=84=88=EB=A1=9C=20QR=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=8A=A4=EC=BA=94=20=EC=8B=9C=20URL=20?= =?UTF-8?q?=EC=A3=BC=EC=86=8C=20=EC=9E=90=EB=8F=99=20=ED=8C=8C=EC=8B=B1=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 인앱 스캐너 카메라로 스캔한 결과에 웹 주소(URL)가 포함되어 있는 경우, 쿼리 스트링 파라미터에서 순수 위치 코드(loc) 및 자산 코드(asset) 값을 자동으로 추출하여 서버로 전송하도록 수정 --- src/mobile-main.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/mobile-main.ts b/src/mobile-main.ts index 51cfdb6..48d0e9f 100644 --- a/src/mobile-main.ts +++ b/src/mobile-main.ts @@ -81,7 +81,21 @@ document.addEventListener('DOMContentLoaded', () => { function processScannedCode(rawCode: string) { // QR 코드 인쇄 폼 등으로 인한 개행 문자(\r, \n) 및 모든 공백 문자(\s)를 제거 - const code = rawCode.replace(/[\r\n]/g, '').replace(/\s+/g, '').trim(); + let code = rawCode.replace(/[\r\n]/g, '').replace(/\s+/g, '').trim(); + + // 만약 스캔된 텍스트가 전체 URL 주소 형식이라면 파라미터 값만 추출하여 정제 + if (code.includes('http://') || code.includes('https://') || code.includes('/mobile')) { + try { + const urlObj = new URL(code, window.location.origin); + const locParam = urlObj.searchParams.get('loc'); + const assetParam = urlObj.searchParams.get('asset'); + + if (locParam) code = locParam; + else if (assetParam) code = assetParam; + } catch (e) { + console.error("URL 파싱 에러:", e); + } + } // 1. Check if the code is a physical location code if (code.startsWith('LOC-')) {