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
|
const body = req.body
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const search = await GameInfo.findOne({
|
const search = await GameInfo.findOne({
|
||||||
_id: body._id,
|
_id: body._id,
|
||||||
deleted: false,
|
deleted: false,
|
||||||
})
|
})
|
||||||
if (search) {
|
if (search) {
|
||||||
|
|
||||||
if (body.info) {
|
if (body.info) {
|
||||||
const info = body.info
|
const info = body.info
|
||||||
const platformInfo = search.platforms[info.platformIndex]
|
const platformInfo = search.platforms[info.platformIndex]
|
||||||
const curStatus = platformInfo.status
|
const curStatus = platformInfo ? platformInfo.status : ''
|
||||||
|
delete body.platforms[info.platformIndex].newPlatform
|
||||||
delete body.info
|
delete body.info
|
||||||
|
|
||||||
// 状态变更会新增平台 发送通知
|
// 状态变更会新增平台 发送通知
|
||||||
if (curStatus !== info.status || !platformInfo) {
|
if (curStatus !== info.status || !platformInfo) {
|
||||||
|
|
||||||
let token = ''
|
let token = ''
|
||||||
const loginRes = await axios({
|
const loginRes = await axios({
|
||||||
url: config.minigame.api + 'gettoken/',
|
url: config.minigame.api + 'gettoken/',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user