This commit is contained in:
COOL 2022-03-26 17:20:58 +08:00
commit 729eb94da2
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;
}