New task
## 수정 내용 **CAPTCHA TOO FREQUENT 해결:** - `redeemOne`에서 **불필요한 PLAYER API 호출 완전 제거** (각 쿠폰마다 player 호출하던 것 삭제) - 캡차 재시도 시 **2초 딜레이** 추가 - 쿠폰 간 딜레이 **1.5초 → 3초**로 증가 **모바일 반응형:** - 640px 이하에서 2단 컬럼 → **세로 1단** 전환 - FID 입력창 + 버튼 세로 배치 - 카드 패딩/글자 크기 모바일에 맞게 조정
This commit is contained in:
parent
cd6c296fb7
commit
54db115b05
@ -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;
|
||||
|
||||
@ -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; }
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user