用户状态接口增加返回是否获得白名单的字段
This commit is contained in:
parent
a5221144ab
commit
149a44cc76
@ -316,13 +316,21 @@ class BoxController extends BaseController {
|
||||
chest.status = ChestStatusEnum.OPENED
|
||||
const score = chest.scoreInit + chest.scoreBonus
|
||||
const dateTag = formatDate(new Date())
|
||||
let items = await generateChestBonus(chest)
|
||||
if (!chest.items) {
|
||||
chest.items = []
|
||||
let items: any[] = []
|
||||
if (!user.inWhiteList) {
|
||||
items = await generateChestBonus(chest)
|
||||
if (!chest.items) {
|
||||
chest.items = []
|
||||
}
|
||||
items.forEach(item => {
|
||||
chest.items.push(item.id)
|
||||
})
|
||||
if (items.find(item => item.type === 1)) {
|
||||
user.inWhiteList = true
|
||||
await user.save()
|
||||
}
|
||||
}
|
||||
items.forEach(item => {
|
||||
chest.items.push(item.id)
|
||||
})
|
||||
|
||||
await updateRankScore({
|
||||
user: user.id,
|
||||
score: score,
|
||||
|
@ -102,6 +102,9 @@ export class ActivityUserClass extends BaseModule {
|
||||
@prop()
|
||||
public discordName?: string
|
||||
|
||||
@prop({ default: false })
|
||||
public inWhiteList: boolean
|
||||
|
||||
@prop({ default: 1 })
|
||||
public boost: number
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user