From ef88811ccb8d8ba20df29ac6bd8f73eadf2990bf Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 2 Sep 2026 17:31:06 +0800 Subject: [PATCH] fix(frontend): call versioned CAP challenge and redeem APIs Point the PoW solver at /api/v1/cap/{challenge,redeem} so login verification hits the routes registered by the cap plugin. --- frontend/lib/cap-solver.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/lib/cap-solver.ts b/frontend/lib/cap-solver.ts index 7ca45473..3abcc371 100644 --- a/frontend/lib/cap-solver.ts +++ b/frontend/lib/cap-solver.ts @@ -135,7 +135,7 @@ function solveInWorker( export async function getCapToken(scope = 'login'): Promise { // 1. 获取难题 - const challengeRes = await fetch('/api/cap/challenge', { + const challengeRes = await fetch('/api/v1/cap/challenge', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ scope }), @@ -171,7 +171,7 @@ export async function getCapToken(scope = 'login'): Promise { console.groupEnd(); // 3. 提交答案兑换一次性凭证 - const redeemRes = await fetch('/api/cap/redeem', { + const redeemRes = await fetch('/api/v1/cap/redeem', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ token: challenge.token, solutions, scope }),