aduid setting-ac
This commit is contained in:
parent
858c34232c
commit
59e3f2e84c
@ -361,6 +361,7 @@ router.post('/uid', async (req, res, next) => {
|
||||
platform_id: body.platform_id,
|
||||
channel_name: body.channel_name,
|
||||
channel_id: body.channel_id,
|
||||
appid: body.appid
|
||||
})
|
||||
const result = await newAdUid.save()
|
||||
res.send({
|
||||
@ -399,6 +400,7 @@ router.put('/uid', async (req, res, next) => {
|
||||
platform_id: body.platform_id,
|
||||
channel_name: body.channel_name,
|
||||
channel_id: body.channel_id,
|
||||
appid: body.appid
|
||||
}
|
||||
)
|
||||
res.send({
|
||||
|
@ -1,56 +1,56 @@
|
||||
import _ from 'lodash';
|
||||
import SystemDic from '../../models/admin/SystemDic';
|
||||
import GameInfo from '../../models/snoopy/GameInfo';
|
||||
import RedisDao from '../../redis/redis.dao';
|
||||
import { Router } from 'express';
|
||||
import redis from 'redis';
|
||||
import config from '../../../config/config';
|
||||
import logger from '../../utils/logger';
|
||||
import _ from 'lodash'
|
||||
import SystemDic from '../../models/admin/SystemDic'
|
||||
import GameInfo from '../../models/snoopy/GameInfo'
|
||||
import RedisDao from '../../redis/redis.dao'
|
||||
import {Router} from 'express'
|
||||
import redis from 'redis'
|
||||
import config from '../../../config/config'
|
||||
import logger from '../../utils/logger'
|
||||
|
||||
const router = new Router();
|
||||
const redisDao = new RedisDao();
|
||||
const router = new Router()
|
||||
const redisDao = new RedisDao()
|
||||
|
||||
/* 获取所有游戏配置*/
|
||||
router.get('/games', async (req, res, next) => {
|
||||
// logger.db(req, '游戏管理', '配置管理', '获取所有游戏配置信息');
|
||||
const type = parseInt(req.query.type);
|
||||
const type = parseInt(req.query.type)
|
||||
try {
|
||||
const pattern = !type ? 'config*' : 'private_config*';
|
||||
const results = await redisDao.scanAsync('0', pattern, []);
|
||||
let games = [];
|
||||
const gameList = await GameInfo.find({ deleted: false });
|
||||
const gameMap = new Map();
|
||||
const pattern = !type ? 'config*' : 'private_config*'
|
||||
const results = await redisDao.scanAsync('0', pattern, [])
|
||||
let games = []
|
||||
const gameList = await GameInfo.find({deleted: false})
|
||||
const gameMap = new Map()
|
||||
for (const g of gameList) {
|
||||
gameMap.set(g.game_id, g.game_name);
|
||||
gameMap.set(g.game_id, g.game_name)
|
||||
}
|
||||
const platforms = await SystemDic.find({
|
||||
type: 'platform',
|
||||
deleted: false
|
||||
});
|
||||
const platformMap = new Map();
|
||||
deleted: false,
|
||||
})
|
||||
const platformMap = new Map()
|
||||
for (const p of platforms) {
|
||||
platformMap.set(p.key, p.value);
|
||||
platformMap.set(p.key, p.value)
|
||||
}
|
||||
for (const result of results) {
|
||||
const infos = result.split(':');
|
||||
const infos = result.split(':')
|
||||
const gameObj = {
|
||||
id: infos[1],
|
||||
platform_id: infos[2]
|
||||
};
|
||||
if (infos.length > 2) {
|
||||
gameObj.name = gameMap.get(infos[1]);
|
||||
gameObj.platform = platformMap.get(infos[2]);
|
||||
platform_id: infos[2],
|
||||
}
|
||||
games.push(gameObj);
|
||||
if (infos.length > 2) {
|
||||
gameObj.name = gameMap.get(infos[1])
|
||||
gameObj.platform = platformMap.get(infos[2])
|
||||
}
|
||||
games.push(gameObj)
|
||||
}
|
||||
games = _.sortBy(games, o => {
|
||||
return o.id;
|
||||
});
|
||||
res.json({ errcode: 0, errmsg: '', rows: games, total: games.length });
|
||||
return o.id
|
||||
})
|
||||
res.json({errcode: 0, errmsg: '', rows: games, total: games.length})
|
||||
} catch (err) {
|
||||
next(err);
|
||||
next(err)
|
||||
}
|
||||
});
|
||||
})
|
||||
/* 获取单个游戏的配置*/
|
||||
router.get('/one_game_cfg', async (req, res, next) => {
|
||||
// logger.db(req, '游戏管理', '配置管理', '获取单个游戏配置信息');
|
||||
@ -60,53 +60,53 @@ router.get('/one_game_cfg', async (req, res, next) => {
|
||||
req.user.permissions.includes(`${req.query.uid}-readable`) ||
|
||||
req.user.permissions.includes(`${req.query.uid}-edit`) ||
|
||||
req.user.permissions.includes(`${req.query.uid}-publish`) ||
|
||||
req.user.permissions.includes(`games-writeable`);
|
||||
req.user.permissions.includes(`games-writeable`)
|
||||
if (!hasPerm) {
|
||||
res.status(403).send({
|
||||
errcode: 1,
|
||||
errmsg: '用户无游戏编辑权限!'
|
||||
});
|
||||
return;
|
||||
errmsg: '用户无游戏编辑权限!',
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const id = req.query.id;
|
||||
const pid = req.query.pid;
|
||||
const type = parseInt(req.query.type);
|
||||
const key = !type ? `config:${id}:${pid}` : `private_config:${id}:${pid}`;
|
||||
const id = req.query.id
|
||||
const pid = req.query.pid
|
||||
const type = parseInt(req.query.type)
|
||||
const key = !type ? `config:${id}:${pid}` : `private_config:${id}:${pid}`
|
||||
const flag = !type
|
||||
? `config_publish:${id}:${pid}`
|
||||
: `private_config_publish:${id}:${pid}`;
|
||||
: `private_config_publish:${id}:${pid}`
|
||||
try {
|
||||
let records = await redisDao.getByKey(key);
|
||||
let published = await redisDao.getByKey(flag);
|
||||
let records = await redisDao.getByKey(key)
|
||||
let published = await redisDao.getByKey(flag)
|
||||
const platforms = await SystemDic.find({
|
||||
type: 'game_cfg',
|
||||
deleted: false
|
||||
});
|
||||
const platformMap = new Map();
|
||||
deleted: false,
|
||||
})
|
||||
const platformMap = new Map()
|
||||
for (const p of platforms) {
|
||||
platformMap.set(p.key, p.value);
|
||||
platformMap.set(p.key, p.value)
|
||||
}
|
||||
if (records) {
|
||||
records = JSON.parse(records);
|
||||
records = JSON.parse(records)
|
||||
for (const record of records) {
|
||||
const cfg = platformMap.get(record.key);
|
||||
record.title = !cfg || !cfg.title ? record.key : cfg.title;
|
||||
record.type = !cfg || !cfg.type ? 'string' : cfg.type;
|
||||
const cfg = platformMap.get(record.key)
|
||||
record.title = !cfg || !cfg.title ? record.key : cfg.title
|
||||
record.type = !cfg || !cfg.type ? 'string' : cfg.type
|
||||
}
|
||||
} else {
|
||||
records = [];
|
||||
records = []
|
||||
}
|
||||
res.json({
|
||||
errcode: 0,
|
||||
errmsg: '',
|
||||
records: records,
|
||||
published: published === '1' ? true : false
|
||||
});
|
||||
published: published === '1' ? true : false,
|
||||
})
|
||||
} catch (err) {
|
||||
next(err);
|
||||
next(err)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
/* 还原配置(获取正式配置) */
|
||||
router.get('/reset_one_game_cfg', async (req, res, next) => {
|
||||
@ -117,262 +117,320 @@ router.get('/reset_one_game_cfg', async (req, res, next) => {
|
||||
req.user.permissions.includes(`${req.query.uid}-readable`) ||
|
||||
req.user.permissions.includes(`${req.query.uid}-edit`) ||
|
||||
req.user.permissions.includes(`${req.query.uid}-publish`) ||
|
||||
req.user.permissions.includes(`games-writeable`);
|
||||
req.user.permissions.includes(`games-writeable`)
|
||||
if (!hasPerm) {
|
||||
res.status(403).send({
|
||||
errcode: 1,
|
||||
errmsg: '用户无游戏编辑权限!'
|
||||
});
|
||||
return;
|
||||
errmsg: '用户无游戏编辑权限!',
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const id = req.query.id;
|
||||
const pid = req.query.pid;
|
||||
const type = parseInt(req.query.type);
|
||||
const key = !type ? `config:${id}:${pid}` : `private_config:${id}:${pid}`;
|
||||
const id = req.query.id
|
||||
const pid = req.query.pid
|
||||
const type = parseInt(req.query.type)
|
||||
const key = !type ? `config:${id}:${pid}` : `private_config:${id}:${pid}`
|
||||
|
||||
const client = redis.createClient({
|
||||
host: config.redisPublish.host,
|
||||
port: config.redisPublish.port,
|
||||
password: config.redisPublish.password
|
||||
});
|
||||
password: config.redisPublish.password,
|
||||
})
|
||||
|
||||
try {
|
||||
let records = await client.getAsync(key);
|
||||
let records = await client.getAsync(key)
|
||||
|
||||
const platforms = await SystemDic.find({
|
||||
type: 'game_cfg',
|
||||
deleted: false
|
||||
});
|
||||
const platformMap = new Map();
|
||||
deleted: false,
|
||||
})
|
||||
const platformMap = new Map()
|
||||
for (const p of platforms) {
|
||||
platformMap.set(p.key, p.value);
|
||||
platformMap.set(p.key, p.value)
|
||||
}
|
||||
if (records) {
|
||||
records = JSON.parse(records);
|
||||
records = JSON.parse(records)
|
||||
for (const record of records) {
|
||||
const cfg = platformMap.get(record.key);
|
||||
record.title = !cfg || !cfg.title ? record.key : cfg.title;
|
||||
record.type = !cfg || !cfg.type ? 'string' : cfg.type;
|
||||
const cfg = platformMap.get(record.key)
|
||||
record.title = !cfg || !cfg.title ? record.key : cfg.title
|
||||
record.type = !cfg || !cfg.type ? 'string' : cfg.type
|
||||
}
|
||||
} else {
|
||||
records = [];
|
||||
records = []
|
||||
}
|
||||
res.json({
|
||||
errcode: 0,
|
||||
errmsg: '',
|
||||
records: records
|
||||
});
|
||||
records: records,
|
||||
})
|
||||
} catch (err) {
|
||||
next(err);
|
||||
next(err)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
/* 删除一个游戏配置*/
|
||||
router.post('/delete_cfg', async (req, res, next) => {
|
||||
logger.db(req, '游戏管理', '配置管理', '删除单个游戏配置信息');
|
||||
logger.db(req, '游戏管理', '配置管理', '删除单个游戏配置信息')
|
||||
// 权限判断
|
||||
const hasPerm =
|
||||
req.user.permissions.includes(`${req.body.uid}-edit`) ||
|
||||
req.user.permissions.includes(`${req.body.uid}-publish`) ||
|
||||
req.user.permissions.includes(`games-writeable`);
|
||||
req.user.permissions.includes(`games-writeable`)
|
||||
if (!hasPerm) {
|
||||
res.status(403).send({
|
||||
errcode: 1,
|
||||
errmsg: '用户无游戏编辑权限!'
|
||||
});
|
||||
return;
|
||||
errmsg: '用户无游戏编辑权限!',
|
||||
})
|
||||
return
|
||||
}
|
||||
const games = req.body.games;
|
||||
const type = parseInt(req.body.type);
|
||||
let keys;
|
||||
const games = req.body.games
|
||||
const type = parseInt(req.body.type)
|
||||
let keys
|
||||
if (type) {
|
||||
keys = games.map(o => `private_config:${o.id}:${o.platform_id}`);
|
||||
keys = games.map(o => `private_config:${o.id}:${o.platform_id}`)
|
||||
} else {
|
||||
keys = games.map(o => `config:${o.id}:${o.platform_id}`);
|
||||
keys = games.map(o => `config:${o.id}:${o.platform_id}`)
|
||||
}
|
||||
try {
|
||||
await redisDao.deleteKeys(keys);
|
||||
res.json({ errcode: 0, errmsg: '' });
|
||||
await redisDao.deleteKeys(keys)
|
||||
res.json({errcode: 0, errmsg: ''})
|
||||
} catch (err) {
|
||||
next(err);
|
||||
next(err)
|
||||
}
|
||||
});
|
||||
})
|
||||
/* 更新配置*/
|
||||
router.post('/save_cfg', async (req, res, next) => {
|
||||
logger.db(req, '游戏管理', '配置管理', '更新单个游戏配置信息');
|
||||
logger.db(req, '游戏管理', '配置管理', '更新单个游戏配置信息')
|
||||
// 权限判断
|
||||
const hasPerm =
|
||||
req.user.permissions.includes(`${req.body.uid}-edit`) ||
|
||||
req.user.permissions.includes(`${req.body.uid}-publish`) ||
|
||||
req.user.permissions.includes(`games-writeable`);
|
||||
req.user.permissions.includes(`games-writeable`)
|
||||
if (!hasPerm) {
|
||||
res.status(403).send({
|
||||
errcode: 1,
|
||||
errmsg: '用户无游戏编辑权限!'
|
||||
});
|
||||
return;
|
||||
errmsg: '用户无游戏编辑权限!',
|
||||
})
|
||||
return
|
||||
}
|
||||
const body = req.body;
|
||||
const cfgs = body.cfgs;
|
||||
const gameId = body.gameId;
|
||||
const platform = body.platform;
|
||||
const type = parseInt(body.type);
|
||||
const body = req.body
|
||||
const cfgs = body.cfgs
|
||||
const gameId = body.gameId
|
||||
const platform = body.platform
|
||||
const type = parseInt(body.type)
|
||||
const key = !type
|
||||
? `config:${gameId}:${platform}`
|
||||
: `private_config:${gameId}:${platform}`;
|
||||
: `private_config:${gameId}:${platform}`
|
||||
const flag = !type
|
||||
? `config_publish:${gameId}:${platform}`
|
||||
: `private_config_publish:${gameId}:${platform}`;
|
||||
: `private_config_publish:${gameId}:${platform}`
|
||||
for (const cfg of cfgs) {
|
||||
if (cfg.type === 'bool' || cfg.type === 'num') {
|
||||
cfg.value = Number(cfg.value);
|
||||
cfg.value = Number(cfg.value)
|
||||
}
|
||||
delete cfg.title;
|
||||
delete cfg.type;
|
||||
delete cfg.title
|
||||
delete cfg.type
|
||||
}
|
||||
const cfgStr = JSON.stringify(cfgs);
|
||||
const cfgStr = JSON.stringify(cfgs)
|
||||
try {
|
||||
await redisDao.updateOneKey(key, cfgStr);
|
||||
await redisDao.updateOneKey(flag, 0);
|
||||
res.json({ errcode: 0, errmsg: '' });
|
||||
await redisDao.updateOneKey(key, cfgStr)
|
||||
await redisDao.updateOneKey(flag, 0)
|
||||
res.json({errcode: 0, errmsg: ''})
|
||||
} catch (err) {
|
||||
next(err);
|
||||
next(err)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
/* 发布配置*/
|
||||
router.post('/publish_cfg', async (req, res, next) => {
|
||||
logger.db(req, '游戏管理', '配置管理', '发布游戏配置信息');
|
||||
logger.db(req, '游戏管理', '配置管理', '发布游戏配置信息')
|
||||
// 权限判断
|
||||
const hasPerm =
|
||||
req.user.permissions.includes(`${req.body.uid}-edit`) ||
|
||||
req.user.permissions.includes(`${req.body.uid}-publish`) ||
|
||||
req.user.permissions.includes(`games-writeable`);
|
||||
req.user.permissions.includes(`games-writeable`)
|
||||
if (!hasPerm) {
|
||||
res.status(403).send({
|
||||
errcode: 1,
|
||||
errmsg: '用户无游戏编辑权限!'
|
||||
});
|
||||
return;
|
||||
errmsg: '用户无游戏编辑权限!',
|
||||
})
|
||||
return
|
||||
}
|
||||
const body = req.body;
|
||||
const cfgs = body.cfgs;
|
||||
const gameId = body.gameId;
|
||||
const platform = body.platform;
|
||||
const type = parseInt(body.type);
|
||||
const body = req.body
|
||||
const cfgs = body.cfgs
|
||||
const gameId = body.gameId
|
||||
const platform = body.platform
|
||||
const type = parseInt(body.type)
|
||||
const key = !type
|
||||
? `config:${gameId}:${platform}`
|
||||
: `private_config:${gameId}:${platform}`;
|
||||
: `private_config:${gameId}:${platform}`
|
||||
const flag = !type
|
||||
? `config_publish:${gameId}:${platform}`
|
||||
: `private_config_publish:${gameId}:${platform}`;
|
||||
: `private_config_publish:${gameId}:${platform}`
|
||||
|
||||
const client = redis.createClient({
|
||||
host: config.redisPublish.host,
|
||||
port: config.redisPublish.port,
|
||||
password: config.redisPublish.password
|
||||
});
|
||||
password: config.redisPublish.password,
|
||||
})
|
||||
|
||||
for (const cfg of cfgs) {
|
||||
if (cfg.type === 'bool' || cfg.type === 'num') {
|
||||
cfg.value = Number(cfg.value);
|
||||
cfg.value = Number(cfg.value)
|
||||
}
|
||||
delete cfg.title;
|
||||
delete cfg.type;
|
||||
delete cfg.title
|
||||
delete cfg.type
|
||||
}
|
||||
const cfgStr = JSON.stringify(cfgs);
|
||||
const cfgStr = JSON.stringify(cfgs)
|
||||
try {
|
||||
await client.setAsync(key, cfgStr);
|
||||
await client.setAsync(flag, 1);
|
||||
res.json({ errcode: 0, errmsg: '' });
|
||||
await client.setAsync(key, cfgStr)
|
||||
await client.setAsync(flag, 1)
|
||||
res.json({errcode: 0, errmsg: ''})
|
||||
} catch (err) {
|
||||
next(err);
|
||||
next(err)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
/* 获取所有配置项*/
|
||||
router.get('/sys_dics', async (req, res, next) => {
|
||||
// logger.db(req, '游戏管理', '配置管理', '获取所有配置项');
|
||||
const type = req.query.type;
|
||||
const type = req.query.type
|
||||
try {
|
||||
const cfgs = await SystemDic.find({ type: type, deleted: false }).select(
|
||||
const cfgs = await SystemDic.find({type: type, deleted: false}).select(
|
||||
'key value comment disabled'
|
||||
);
|
||||
)
|
||||
|
||||
res.json({ errcode: 0, errmsg: '', records: cfgs });
|
||||
res.json({errcode: 0, errmsg: '', records: cfgs})
|
||||
} catch (err) {
|
||||
next(err);
|
||||
next(err)
|
||||
}
|
||||
});
|
||||
})
|
||||
/* 保存一个新的配置项*/
|
||||
router.post('/save_sys_dic', async (req, res, next) => {
|
||||
logger.db(req, '游戏管理', '配置管理', '添加一个配置项');
|
||||
logger.db(req, '游戏管理', '配置管理', '添加一个配置项')
|
||||
// 权限判断
|
||||
const hasPerm =
|
||||
req.user.permissions.includes(`settings-writeable`) ||
|
||||
req.user.permissions.includes(`games-writeable`);
|
||||
req.user.permissions.includes(`games-writeable`)
|
||||
if (!hasPerm) {
|
||||
res.status(403).send({
|
||||
errcode: 1,
|
||||
errmsg: '用户无配置项编辑权限!'
|
||||
});
|
||||
return;
|
||||
errmsg: '用户无配置项编辑权限!',
|
||||
})
|
||||
return
|
||||
}
|
||||
const body = req.body;
|
||||
const record = body.record;
|
||||
const user = req.user;
|
||||
const type = !body.type ? 'game_cfg' : body.type;
|
||||
const body = req.body
|
||||
const record = body.record
|
||||
const user = req.user
|
||||
const type = !body.type ? 'game_cfg' : body.type
|
||||
|
||||
const id = record ? record.id : '';
|
||||
const id = record ? record.id : ''
|
||||
try {
|
||||
const cfg = await SystemDic.findOne({
|
||||
type: type,
|
||||
deleted: false,
|
||||
key: record.key
|
||||
});
|
||||
key: record.key,
|
||||
})
|
||||
if (cfg) {
|
||||
if (!id) {
|
||||
return res.json({ errcode: 101, errmsg: 'key已存在' });
|
||||
return res.json({errcode: 101, errmsg: 'key已存在'})
|
||||
} else {
|
||||
if (cfg.id !== id) {
|
||||
return res.json({ errcode: 101, errmsg: 'key已存在' });
|
||||
return res.json({errcode: 101, errmsg: 'key已存在'})
|
||||
}
|
||||
}
|
||||
}
|
||||
let val;
|
||||
let val
|
||||
if (record.val) {
|
||||
val = record.val;
|
||||
val = record.val
|
||||
} else {
|
||||
val = {
|
||||
title: record.title,
|
||||
type: record.type
|
||||
};
|
||||
type: record.type,
|
||||
}
|
||||
}
|
||||
let recordDb;
|
||||
let recordDb
|
||||
if (id) {
|
||||
recordDb = await SystemDic.findById(id);
|
||||
recordDb = await SystemDic.findById(id)
|
||||
} else {
|
||||
recordDb = new SystemDic({
|
||||
type: type,
|
||||
createdBy: user.username
|
||||
});
|
||||
createdBy: user.username,
|
||||
})
|
||||
}
|
||||
recordDb.key = record.key;
|
||||
recordDb.value = val;
|
||||
recordDb.comment = record.comment;
|
||||
recordDb.disabled = record.disabled;
|
||||
recordDb.lastModifiedBy = user.username;
|
||||
recordDb.key = record.key
|
||||
recordDb.value = val
|
||||
recordDb.comment = record.comment
|
||||
recordDb.disabled = record.disabled
|
||||
recordDb.lastModifiedBy = user.username
|
||||
|
||||
await recordDb.save();
|
||||
await recordDb.save()
|
||||
res.json({
|
||||
errcode: 0,
|
||||
errmsg: '',
|
||||
record: { _id: recordDb.id, key: recordDb.key, value: recordDb.value }
|
||||
});
|
||||
record: {_id: recordDb.id, key: recordDb.key, value: recordDb.value},
|
||||
})
|
||||
} catch (err) {
|
||||
next(err);
|
||||
next(err)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
export default router;
|
||||
/* 获取达成条件*/
|
||||
router.get('/ac-conds', async (req, res, next) => {
|
||||
// 权限判断
|
||||
const hasPerm =
|
||||
req.user.permissions.includes(`${req.query.uid}-readable`) ||
|
||||
req.user.permissions.includes(`${req.query.uid}-edit`) ||
|
||||
req.user.permissions.includes(`${req.query.uid}-publish`) ||
|
||||
req.user.permissions.includes(`games-writeable`)
|
||||
if (!hasPerm) {
|
||||
res.status(403).send({
|
||||
errcode: 1,
|
||||
errmsg: '用户无配置项编辑权限!',
|
||||
})
|
||||
return
|
||||
}
|
||||
const query = req.query
|
||||
const key = `config:${query.game_id}:ac-conds`
|
||||
|
||||
try {
|
||||
const result = await redisDao.getByKey(key)
|
||||
res.send({
|
||||
errcode: 0,
|
||||
result: JSON.parse(result) || {},
|
||||
})
|
||||
} catch (err) {
|
||||
next(err)
|
||||
}
|
||||
})
|
||||
|
||||
/* 保存达成条件*/
|
||||
router.post('/ac-conds', async (req, res, next) => {
|
||||
logger.db(req, '游戏管理', '配置管理', '更新达成条件列表')
|
||||
// 权限判断
|
||||
const hasPerm =
|
||||
req.user.permissions.includes(`${req.body.uid}-edit`) ||
|
||||
req.user.permissions.includes(`${req.body.uid}-publish`) ||
|
||||
req.user.permissions.includes(`games-writeable`)
|
||||
if (!hasPerm) {
|
||||
res.status(403).send({
|
||||
errcode: 1,
|
||||
errmsg: '用户无配置项编辑权限!',
|
||||
})
|
||||
return
|
||||
}
|
||||
const body = req.body
|
||||
const key = `config:${body.game_id}:ac-conds`
|
||||
const acConds = JSON.stringify(body.acConds)
|
||||
|
||||
try {
|
||||
const result = await redisDao.updateOneKey(key, acConds)
|
||||
res.send({
|
||||
errcode: 0,
|
||||
})
|
||||
} catch (err) {
|
||||
next(err)
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
||||
|
@ -13,6 +13,7 @@ const AdUid = new mongoose.Schema(
|
||||
channel_name: {type: String},
|
||||
channel_id: {type: String},
|
||||
deleted: {type: Boolean, default: false},
|
||||
appid: {type: String}
|
||||
},
|
||||
{
|
||||
collection: 'ad_uid',
|
||||
|
Loading…
x
Reference in New Issue
Block a user