merge: thoon 브랜치 병합 (모바일 인앱 스캐너 QR 코드 URL 주소 자동 파싱)
All checks were successful
ITAM Code Check / build-and-config-check (push) Successful in 11s
ITAM Docker Build Check / docker-build-check (push) Successful in 17s

This commit is contained in:
이태훈
2026-06-29 15:40:10 +09:00

View File

@@ -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-')) {