服务器:修改服务器列表

This commit is contained in:
luying
2021-06-11 10:09:35 +08:00
parent f1fa6ae354
commit 51efc2f0dc
5 changed files with 34 additions and 40 deletions

View File

@@ -29,13 +29,9 @@ export default class Game extends Service {
/**
* 获取正式服,测试服,开发服等环境
*/
public async getServerListByEnv() {
const { ctx, app } = this;
const envlist = await GameModel.getServerEnvList();
let cur = envlist.find(cur => cur.env == app.config.env);
if(!cur) return ctx.service.utils.resResult(STATUS.SUCCESS, { list: [] });
const list = await ServerlistModel.findByServerType(cur.serverType);
public async getServerListByEnv(serverType?: string) {
const { ctx } = this;
const list = await ServerlistModel.findByServerType(serverType);
return ctx.service.utils.resResult(STATUS.SUCCESS, {
list