This commit is contained in:
cool_team 2022-03-25 16:32:59 +08:00
parent ad38c8e9b8
commit 8e7c63635d
2 changed files with 4 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import { LoginDTO } from '../../dto/login';
import { BaseSysLoginService } from '../../service/sys/login';
import { BaseSysParamService } from '../../service/sys/param';
import { Context } from '@midwayjs/koa';
import { Validate } from '@midwayjs/validate';
/**
*
@ -53,7 +54,8 @@ export class BaseOpenController extends BaseController {
* @param login
*/
@Post('/login', { summary: '登录' })
async login(@Body(ALL) login: LoginDTO) {
@Validate()
async login(@Body() login: LoginDTO) {
return this.ok(await this.baseSysLoginService.login(login));
}

View File

@ -16,6 +16,6 @@ export class LoginDTO {
captchaId: string;
// 验证码
@Rule(RuleType.string().required())
@Rule(RuleType.required())
verifyCode: number;
}