mirror of https://github.com/certd/certd
补充接口自助找回判断
parent
47d6e0e8fe
commit
786affc551
|
@ -22,6 +22,7 @@ export class SysPublicSettings extends BaseSettings {
|
||||||
mobileRegisterEnabled = false;
|
mobileRegisterEnabled = false;
|
||||||
smsLoginEnabled = false;
|
smsLoginEnabled = false;
|
||||||
emailRegisterEnabled = false;
|
emailRegisterEnabled = false;
|
||||||
|
selfServicePasswordRetrievalEnabled = false;
|
||||||
|
|
||||||
limitUserPipelineCount = 0;
|
limitUserPipelineCount = 0;
|
||||||
managerOtherUserPipeline = false;
|
managerOtherUserPipeline = false;
|
||||||
|
|
|
@ -98,7 +98,7 @@ const rules = {
|
||||||
imgCode: [{ required: true }, { min: 4, max: 4, message: "请输入4位图片验证码" }],
|
imgCode: [{ required: true }, { min: 4, max: 4, message: "请输入4位图片验证码" }],
|
||||||
password: [
|
password: [
|
||||||
{ required: true, trigger: "change", message: "请输入密码" },
|
{ required: true, trigger: "change", message: "请输入密码" },
|
||||||
{ len: 6, message: "至少输入6位密码" },
|
{ min: 6, message: "至少输入6位密码" },
|
||||||
],
|
],
|
||||||
confirmPassword: [
|
confirmPassword: [
|
||||||
{ required: true, trigger: "change", message: "请确认密码" },
|
{ required: true, trigger: "change", message: "请确认密码" },
|
||||||
|
|
|
@ -24,6 +24,11 @@ export class LoginController extends BaseController {
|
||||||
@Body(ALL)
|
@Body(ALL)
|
||||||
body: any,
|
body: any,
|
||||||
) {
|
) {
|
||||||
|
const sysSettings = await this.sysSettingsService.getPublicSettings();
|
||||||
|
if(!sysSettings.selfServicePasswordRetrievalEnabled) {
|
||||||
|
throw new CommonException('暂未开启自助找回');
|
||||||
|
}
|
||||||
|
|
||||||
if(body.type === 'email') {
|
if(body.type === 'email') {
|
||||||
this.codeService.checkEmailCode({
|
this.codeService.checkEmailCode({
|
||||||
verificationType: 'forgotPassword',
|
verificationType: 'forgotPassword',
|
||||||
|
|
Loading…
Reference in New Issue