mirror of
https://github.com/certd/certd.git
synced 2026-04-16 05:50:50 +08:00
feat: 权限控制
This commit is contained in:
@@ -5,6 +5,7 @@ import { Controller, Post, Provide } from '@midwayjs/decorator';
|
||||
import { BaseController } from '../../../basic/base-controller';
|
||||
import { CodeService } from '../service/code-service';
|
||||
import { EmailService } from '../service/email-service';
|
||||
import { Constants } from '../../../basic/constants';
|
||||
export class SmsCodeReq {
|
||||
@Rule(RuleType.number().required())
|
||||
phoneCode: number;
|
||||
@@ -30,7 +31,7 @@ export class BasicController extends BaseController {
|
||||
@Inject()
|
||||
emailService: EmailService;
|
||||
|
||||
@Post('/sendSmsCode')
|
||||
@Post('/sendSmsCode', { summary: Constants.per.guest })
|
||||
public sendSmsCode(
|
||||
@Body(ALL)
|
||||
body: SmsCodeReq
|
||||
@@ -39,7 +40,7 @@ export class BasicController extends BaseController {
|
||||
return this.ok(null);
|
||||
}
|
||||
|
||||
@Post('/captcha')
|
||||
@Post('/captcha', { summary: Constants.per.guest })
|
||||
public async getCaptcha(
|
||||
@Body()
|
||||
randomStr
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Body, Controller, Inject, Post, Provide } from '@midwayjs/decorator';
|
||||
import { BaseController } from '../../../basic/base-controller';
|
||||
import { EmailService } from '../service/email-service';
|
||||
import { Constants } from '../../../basic/constants';
|
||||
|
||||
/**
|
||||
*/
|
||||
@@ -10,7 +11,7 @@ export class EmailController extends BaseController {
|
||||
@Inject()
|
||||
emailService: EmailService;
|
||||
|
||||
@Post('/test')
|
||||
@Post('/test', { summary: Constants.per.authOnly })
|
||||
public async test(
|
||||
@Body('receiver')
|
||||
receiver
|
||||
|
||||
Reference in New Issue
Block a user