From 54db115b05a820f17a6223379205e69881303cd1 Mon Sep 17 00:00:00 2001 From: hyoseung930 <35983843+hyoseung930@users.noreply.github.com> Date: Tue, 19 May 2026 17:49:32 +0900 Subject: [PATCH] New task MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 수정 내용 **CAPTCHA TOO FREQUENT 해결:** - `redeemOne`에서 **불필요한 PLAYER API 호출 완전 제거** (각 쿠폰마다 player 호출하던 것 삭제) - 캡차 재시도 시 **2초 딜레이** 추가 - 쿠폰 간 딜레이 **1.5초 → 3초**로 증가 **모바일 반응형:** - 640px 이하에서 2단 컬럼 → **세로 1단** 전환 - FID 입력창 + 버튼 세로 배치 - 카드 패딩/글자 크기 모바일에 맞게 조정 --- back/src/wos/wos.service.ts | 25 +++++++++---------------- front/src/views/HomeView.vue | 11 +++++++++++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/back/src/wos/wos.service.ts b/back/src/wos/wos.service.ts index e41543d..02cfe31 100644 --- a/back/src/wos/wos.service.ts +++ b/back/src/wos/wos.service.ts @@ -114,15 +114,11 @@ export class WosService { code: string, maxRetries = 5, ): Promise<{ success: boolean; message: string; err_code?: number }> { - const ts1 = this.now(); - const playerSign = this.makePlayerSign(fid, ts1); - await axios.post( - `${WOS_API_BASE}/player`, - new URLSearchParams({ fid, time: String(ts1), sign: playerSign }), - { headers: { ...COMMON_HEADERS } }, - ); - for (let attempt = 1; attempt <= maxRetries; attempt++) { + if (attempt > 1) { + await new Promise((r) => setTimeout(r, 2000)); + } + let captchaCode: string; try { captchaCode = await this.solveCaptcha(fid); @@ -130,11 +126,11 @@ export class WosService { return { success: false, message: `캡차 오류: ${err.message}` }; } - const ts2 = this.now(); - const giftSign = this.makeGiftSign(fid, ts2, code, captchaCode); + const ts = this.now(); + const giftSign = this.makeGiftSign(fid, ts, code, captchaCode); const response = await axios.post( `${WOS_API_BASE}/gift_code`, - new URLSearchParams({ fid, time: String(ts2), sign: giftSign, cdk: code, captcha_code: captchaCode }), + new URLSearchParams({ fid, time: String(ts), sign: giftSign, cdk: code, captcha_code: captchaCode }), { headers: { ...COMMON_HEADERS } }, ); @@ -143,10 +139,7 @@ export class WosService { if (data.code === 0) return { success: true, message: SUCCESS_MSG }; if (data.err_code === 40103) { - if (attempt < maxRetries) { - await new Promise((r) => setTimeout(r, 500)); - continue; - } + if (attempt < maxRetries) continue; return { success: false, message: `캡차 인식 실패 (${maxRetries}회 시도)`, err_code: data.err_code }; } return { success: false, message: data.msg || `실패 (${data.err_code})`, err_code: data.err_code }; @@ -194,7 +187,7 @@ export class WosService { await this.couponLogRepo.save({ fid, coupon_code: coupon.code, result_msg: result.message }); results.push({ name: coupon.name, code: coupon.code, status, message: result.message }); - await new Promise((r) => setTimeout(r, 1500)); + await new Promise((r) => setTimeout(r, 3000)); } return results; diff --git a/front/src/views/HomeView.vue b/front/src/views/HomeView.vue index 58c1f72..bfcc0f7 100644 --- a/front/src/views/HomeView.vue +++ b/front/src/views/HomeView.vue @@ -209,4 +209,15 @@ header h1 { font-size: 1.9rem; color: #1e293b; margin: 0 0 8px; } .btn-primary:hover:not(:disabled) { background: #2563eb; } .error-msg { color: #dc2626; font-size: 0.9rem; margin: 8px 0 0; } .empty { color: #94a3b8; font-size: 0.9rem; margin: 0; text-align: center; padding: 12px 0; } + +@media (max-width: 640px) { + .layout { padding: 16px 12px 40px; } + header h1 { font-size: 1.4rem; } + .columns { flex-direction: column; } + .col-left { width: 100%; } + .user-list { max-height: 180px; } + .search-row { flex-direction: column; } + .search-row .btn { width: 100%; } + .card { padding: 14px; } +}