diff --git a/src/controllers/open/ad-uid.js b/src/controllers/open/ad-uid.js index 8324003..af9b138 100644 --- a/src/controllers/open/ad-uid.js +++ b/src/controllers/open/ad-uid.js @@ -10,7 +10,7 @@ const router = new Router() const redisDao = new RedisDao() // 获取广告区域列表 -router.get('/', cors(), async (req, res, next) => { +router.get('/', async (req, res, next) => { try { const query = req.query const game_id = query.gameid diff --git a/src/controllers/open/games.js b/src/controllers/open/games.js index 88278f0..272047c 100644 --- a/src/controllers/open/games.js +++ b/src/controllers/open/games.js @@ -21,7 +21,7 @@ const corsOptions = { } // 获取广告区域列表 -router.get('/list', cors(), async (req, res, next) => { +router.get('/list', async (req, res, next) => { try { const games = await GameInfo.find({deleted: false}) const result = [] diff --git a/src/controllers/open/jump.js b/src/controllers/open/jump.js index 5a8a953..45cd5ce 100644 --- a/src/controllers/open/jump.js +++ b/src/controllers/open/jump.js @@ -6,19 +6,10 @@ import GameJump from '../../models/admin/GameJump' import cors from 'cors' const router = new Router() -const whitelist = ['https://promotion.kingsome.cn', 'https://promotion-test.kingsome.cn', 'http://promotion.kingsome.cn','http://promotion-test.kingsome.cn'] -const corsOptions = { - origin: function(origin, callback) { - if (whitelist.indexOf(origin) !== -1) { - callback(null, true) - } else { - callback(new Error('Not allowed by CORS')) - } - }, -} + // 获取游戏跳转关联列表 -router.get('/', cors(corsOptions), async (req, res, next) => { +router.get('/', async (req, res, next) => { try { const query = req.query const currentPage = parseInt(query.currentPage) @@ -52,7 +43,7 @@ router.get('/', cors(corsOptions), async (req, res, next) => { }) // 添加关联游戏 -router.post('/', cors(corsOptions), async (req, res, next) => { +router.post('/', async (req, res, next) => { try { const body = req.body const game_id = body.game_id @@ -93,7 +84,7 @@ router.post('/', cors(corsOptions), async (req, res, next) => { } }) // 修改关联游戏 -router.put('/', cors(corsOptions), async (req, res, next) => { +router.put('/', async (req, res, next) => { try { const body = req.body const jump_id = body._id @@ -126,7 +117,7 @@ router.put('/', cors(corsOptions), async (req, res, next) => { }) // 删除关联游戏 -router.delete('/', cors(corsOptions), async (req, res, next) => { +router.delete('/', async (req, res, next) => { try { const body = req.body const jump_id = body.jump_id