games platform update
This commit is contained in:
parent
98d392b5fd
commit
1718b2d845
@ -146,22 +146,22 @@ router.post('/update', async (req, res, next) => {
|
||||
}
|
||||
|
||||
const body = req.body
|
||||
|
||||
try {
|
||||
const search = await GameInfo.findOne({
|
||||
_id: body._id,
|
||||
deleted: false,
|
||||
})
|
||||
if (search) {
|
||||
|
||||
if (body.info) {
|
||||
const info = body.info
|
||||
const platformInfo = search.platforms[info.platformIndex]
|
||||
const curStatus = platformInfo.status
|
||||
const curStatus = platformInfo ? platformInfo.status : ''
|
||||
delete body.platforms[info.platformIndex].newPlatform
|
||||
delete body.info
|
||||
|
||||
// 状态变更会新增平台 发送通知
|
||||
if (curStatus !== info.status || !platformInfo) {
|
||||
|
||||
let token = ''
|
||||
const loginRes = await axios({
|
||||
url: config.minigame.api + 'gettoken/',
|
||||
|
Loading…
x
Reference in New Issue
Block a user