mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2024-11-01 14:10:29 +08:00
5.x
This commit is contained in:
parent
ad38c8e9b8
commit
8e7c63635d
@ -12,6 +12,7 @@ import { LoginDTO } from '../../dto/login';
|
|||||||
import { BaseSysLoginService } from '../../service/sys/login';
|
import { BaseSysLoginService } from '../../service/sys/login';
|
||||||
import { BaseSysParamService } from '../../service/sys/param';
|
import { BaseSysParamService } from '../../service/sys/param';
|
||||||
import { Context } from '@midwayjs/koa';
|
import { Context } from '@midwayjs/koa';
|
||||||
|
import { Validate } from '@midwayjs/validate';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 不需要登录的后台接口
|
* 不需要登录的后台接口
|
||||||
@ -53,7 +54,8 @@ export class BaseOpenController extends BaseController {
|
|||||||
* @param login
|
* @param login
|
||||||
*/
|
*/
|
||||||
@Post('/login', { summary: '登录' })
|
@Post('/login', { summary: '登录' })
|
||||||
async login(@Body(ALL) login: LoginDTO) {
|
@Validate()
|
||||||
|
async login(@Body() login: LoginDTO) {
|
||||||
return this.ok(await this.baseSysLoginService.login(login));
|
return this.ok(await this.baseSysLoginService.login(login));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,6 @@ export class LoginDTO {
|
|||||||
captchaId: string;
|
captchaId: string;
|
||||||
|
|
||||||
// 验证码
|
// 验证码
|
||||||
@Rule(RuleType.string().required())
|
@Rule(RuleType.required())
|
||||||
verifyCode: number;
|
verifyCode: number;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user