更换成就配置redis地址

This commit is contained in:
yulixing 2019-08-20 15:09:41 +08:00
parent 59e3f2e84c
commit 81c0ef5e07
2 changed files with 13 additions and 3 deletions

View File

@ -252,6 +252,7 @@ router.post('/kefu-cfg', async (req, res, next) => {
if (kefuStatus === 200) { if (kefuStatus === 200) {
const key = `kefu:${body.game_id}:6001` const key = `kefu:${body.game_id}:6001`
// TODO: 迁移至正式服redis
await redisDao.updateOneKey( await redisDao.updateOneKey(
key, key,
JSON.stringify({msg_key: body.msg_key, img_url: body.img_url}) JSON.stringify({msg_key: body.msg_key, img_url: body.img_url})

View File

@ -110,7 +110,6 @@ router.get('/one_game_cfg', async (req, res, next) => {
/* 还原配置(获取正式配置) */ /* 还原配置(获取正式配置) */
router.get('/reset_one_game_cfg', async (req, res, next) => { router.get('/reset_one_game_cfg', async (req, res, next) => {
// logger.db(req, '游戏管理', '配置管理', '获取单个游戏正式服配置信息');
// 权限判断 // 权限判断
const hasPerm = const hasPerm =
@ -394,7 +393,12 @@ router.get('/ac-conds', async (req, res, next) => {
const key = `config:${query.game_id}:ac-conds` const key = `config:${query.game_id}:ac-conds`
try { try {
const result = await redisDao.getByKey(key) const client = redis.createClient({
host: config.redisPublish.host,
port: config.redisPublish.port,
password: config.redisPublish.password,
})
const result = await client.getAsync(key)
res.send({ res.send({
errcode: 0, errcode: 0,
result: JSON.parse(result) || {}, result: JSON.parse(result) || {},
@ -424,7 +428,12 @@ router.post('/ac-conds', async (req, res, next) => {
const acConds = JSON.stringify(body.acConds) const acConds = JSON.stringify(body.acConds)
try { try {
const result = await redisDao.updateOneKey(key, acConds) const client = redis.createClient({
host: config.redisPublish.host,
port: config.redisPublish.port,
password: config.redisPublish.password,
})
const result = await client.setAsync(key, acConds)
res.send({ res.send({
errcode: 0, errcode: 0,
}) })