28 lines
812 B
TypeScript
28 lines
812 B
TypeScript
import { Controller } from 'egg';
|
|
|
|
export default class AccountController extends Controller {
|
|
public async getSms() {
|
|
const { ctx } = this;
|
|
const { tel } = ctx.request.body;
|
|
ctx.body = await ctx.service.auth.getSms(tel);
|
|
}
|
|
|
|
public async smsLogin() {
|
|
const { ctx } = this;
|
|
const { tel, code, platform, pkgName, serverType } = ctx.request.body;
|
|
ctx.body = await ctx.service.auth.smsLogin(tel, code, platform, pkgName, serverType);
|
|
}
|
|
|
|
public async checkRole() {
|
|
const { ctx } = this;
|
|
const { serverId } = ctx.request.body;
|
|
ctx.body = await ctx.service.auth.checkRole(serverId);
|
|
}
|
|
|
|
public async createRole() {
|
|
const { ctx } = this;
|
|
const { serverId, roleName } = ctx.request.body;
|
|
ctx.body = await ctx.service.auth.createRole(serverId, roleName);
|
|
}
|
|
}
|