web-server 注册、登录、获取服务器列表;game-server token 校验

This commit is contained in:
liangtongchuan
2020-08-19 14:40:11 +08:00
parent 0458817b51
commit 940879016f
32 changed files with 1144 additions and 38 deletions

View File

@@ -0,0 +1,17 @@
import { SERVER_NOT_FOUND } from './../../../shared/statusCode';
import { STATUS_SUC } from '../../../shared/statusCode';
import { GameModel } from '../db/Game';
import { Controller } from 'egg';
export default class GameController extends Controller {
public async getServerList() {
const { ctx } = this;
const { serverType } = ctx.request.body;
let serverList: Array<any> = await GameModel.getServerListByType(serverType);
if (serverList && serverList.length > 0) {
ctx.body = {status: STATUS_SUC.code, data: { serverList }};
} else {
ctx.body = ctx.service.utils.exceptionResult(SERVER_NOT_FOUND);
}
}
}