测试环境可以给自己助力

This commit is contained in:
CounterFire2023 2024-03-27 13:40:27 +08:00
parent 15cf7d8449
commit 4968dae33e

View File

@ -101,7 +101,8 @@ class BoxController extends BaseController {
if (chest.status === ChestStatusEnum.LOCKED) {
throw new ZError(14, 'chest is locked')
}
if (chest.user === uid) {
// 生产环境不能助力自己
if (process.env.NODE_ENV === 'production' && chest.user === uid) {
throw new ZError(15, 'can not enhance self')
}
const score = Math.floor(Math.random() * (chest.bounsCfg[1] - chest.bounsCfg[0] + 1) + chest.bounsCfg[0])