bug fix: 抽奖时, step增加保护性检查

This commit is contained in:
CounterFire2023 2024-05-15 10:58:25 +08:00
parent 0a5413376c
commit d4e875e423
3 changed files with 41 additions and 2 deletions

View File

@ -387,6 +387,38 @@
"end": "2025-01-01 00:00",
"checkChain": false,
"params": { "time": 6, "failRate": 0 }
},
{
"id": "g3mta63vxgym6hg7swt",
"task": "TwitterRetweet",
"title": "RT - Play-to-airdrop is live now!",
"type": 1,
"desc": "Retweet specific tweets",
"category": "Social Tasks",
"score": 50,
"autoclaim": false,
"pretasks": ["e2yhq2lj30vwcpedv7p"],
"cfg": { "icon": "twitter", "content": "1790369006349918285"},
"start": "2024-01-01 00:00",
"end": "2025-01-01 00:00",
"checkChain": false,
"params": { "time": 6, "failRate": 0 }
},
{
"id": "g3kk4egguh3hkyf8gb8",
"task": "TwitterLike",
"title": "Like - Play-to-airdrop is live now! ",
"type": 1,
"desc": "Like specific tweets",
"category": "Social Tasks",
"score": 50,
"autoclaim": false,
"pretasks": ["e2yhq2lj30vwcpedv7p"],
"cfg": { "icon": "twitter", "content": "1790369006349918285"},
"start": "2024-01-01 00:00",
"end": "2025-01-01 00:00",
"checkChain": false,
"params": { "time": 6, "failRate": 0 }
}
],
"drawTime": 1715245160457,

View File

@ -149,7 +149,14 @@ class InGameController extends BaseController {
await new SyncLocker().checkLock(req)
logger.db('draw_ingame', req)
const user = req.user
const { step } = req.params
let { step } = req.params
if (isNaN(step)) {
throw new ZError(10, 'params mismatch')
}
step = parseInt(step || '1')
if (step < 1) {
step = 1
}
if (!user.gameAccountBinded()) {
throw new ZError(10, 'need connect game account first')
}

View File

@ -34,7 +34,7 @@ export const DEFAULT_VERIFY_MAIL_HTML = `
<p>Use it to login CEBG. Never share this code with anyone.</p>
`
export const DEFAULT_LOGIN_MAIL_SUBJECT = 'Counter Fire email login code'
export const DEFAULT_LOGIN_MAIL_SUBJECT = 'Your Verification Code for Counter Fire'
export const DEFAULT_LOGIN_MAIL_HTML = `
<h1>Enter this code to complete your sign in:</h1>
<h1>{{ocde}}</h1>