前面的ok了, 绑定与角色
This commit is contained in:
@@ -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))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user