添加后台连接用的后端

This commit is contained in:
luying
2020-09-22 11:09:15 +08:00
parent 6e891ec756
commit bcbed5959f
48 changed files with 14845 additions and 2076 deletions

View File

@@ -0,0 +1,24 @@
import { Controller } from 'egg';
export default class LoginController extends Controller {
public async login() {
const { ctx } = this;
const {username, password} = ctx.request.body;
ctx.body = await ctx.service.gmUser.login(username, password);
}
public async currentUser() {
const { ctx } = this;
ctx.body = {
"status": "ok",
"data": ctx.user
};
}
public async createGmAccount() {
const { ctx } = this;
const {password, name, username, group} = ctx.request.body;
ctx.body = await ctx.service.gmUser.createGmAccount(name, username, password, group);
}
}