前面的ok了, 绑定与角色

This commit is contained in:
yml
2026-05-03 20:58:18 +08:00
parent dd2192b6ae
commit 0f0253bffe
30 changed files with 1900 additions and 409 deletions
+22
View File
@@ -10,6 +10,10 @@ import {
reloadClaimSession,
redeemClaimTask,
} from '../services/claim/claim-session-service.js'
import {
getKuaishouCloudClaimGuideAssetPath,
verifyKuaishouCloudClaimTicket,
} from '../services/claim/kuaishou-cloud-claim-service.js'
import { buildNotFoundPayload, buildSuccessPayload, sendRouteError } from '../utils/http.js'
const router = Router()
@@ -77,6 +81,15 @@ router.post('/:token/redeem', async (req, res) => {
}
})
router.post('/:token/kuaishou-cloud/verify-ticket', async (req, res) => {
try {
const data = await verifyKuaishouCloudClaimTicket(req.params.token, req.body)
res.json(buildSuccessPayload(data, '核销码校验成功'))
} catch (error) {
sendRouteError(res, error, '校验核销码失败', '[claims/:token/kuaishou-cloud/verify-ticket]')
}
})
router.get('/:token/screenshot', async (req, res) => {
try {
const screenshotPath = await getClaimScreenshotPath(req.params.token)
@@ -86,6 +99,15 @@ router.get('/:token/screenshot', async (req, res) => {
}
})
router.get('/assets/kuaishou-cloud/:filename', async (req, res) => {
try {
const filePath = await getKuaishouCloudClaimGuideAssetPath(req.params.filename)
res.sendFile(filePath)
} catch (error) {
sendRouteError(res, error, '读取指引图片失败', '[claims/assets/kuaishou-cloud/:filename]')
}
})
router.use((req, res) => {
res.status(404).json(buildNotFoundPayload(req))
})