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; } +}