Files
ZYZ/gm-server/app/controller/login.ts
2021-12-21 19:42:37 +08:00

22 lines
564 B
TypeScript

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 = await ctx.service.gmUser.currentUser();
}
public async changeMyPass() {
const { ctx } = this;
const {uid, password} = ctx.request.body;
ctx.body = await ctx.service.gmUser.changeMyPass(uid, password);
}
}