mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-07 01:18:27 +08:00
验证码调整
This commit is contained in:
parent
9a55b6b8d5
commit
3892b05718
@ -78,8 +78,9 @@ public class NormalAuthenticationProvider extends AbstractAuthenticationProvider
|
|||||||
|
|
||||||
if(this.applicationConfig.getLoginConfig().isCaptcha()) {
|
if(this.applicationConfig.getLoginConfig().isCaptcha()) {
|
||||||
captchaValid(loginCredential.getState(),loginCredential.getCaptcha());
|
captchaValid(loginCredential.getState(),loginCredential.getCaptcha());
|
||||||
}
|
|
||||||
else if(inst.getCaptchaSupport().equalsIgnoreCase("YES")) {
|
}else if(!inst.getCaptcha().equalsIgnoreCase("NONE")) {
|
||||||
|
|
||||||
captchaValid(loginCredential.getState(),loginCredential.getCaptcha());
|
captchaValid(loginCredential.getState(),loginCredential.getCaptcha());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -78,9 +78,8 @@ public class Institutions extends JpaBaseEntity implements Serializable {
|
|||||||
private String consoleTitle;
|
private String consoleTitle;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
private String captchaType;
|
private String captcha;
|
||||||
@Column
|
|
||||||
private String captchaSupport;
|
|
||||||
@Column
|
@Column
|
||||||
private String defaultUri;
|
private String defaultUri;
|
||||||
|
|
||||||
@ -130,14 +129,6 @@ public class Institutions extends JpaBaseEntity implements Serializable {
|
|||||||
this.frontTitle = frontTitle;
|
this.frontTitle = frontTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCaptchaType() {
|
|
||||||
return captchaType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCaptchaType(String captchaType) {
|
|
||||||
this.captchaType = captchaType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getConsoleDomain() {
|
public String getConsoleDomain() {
|
||||||
return consoleDomain;
|
return consoleDomain;
|
||||||
}
|
}
|
||||||
@ -259,12 +250,12 @@ public class Institutions extends JpaBaseEntity implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getCaptchaSupport() {
|
public String getCaptcha() {
|
||||||
return captchaSupport;
|
return captcha;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCaptchaSupport(String captchaSupport) {
|
public void setCaptcha(String captcha) {
|
||||||
this.captchaSupport = captchaSupport;
|
this.captcha = captcha;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefaultUri() {
|
public String getDefaultUri() {
|
||||||
@ -310,16 +301,16 @@ public class Institutions extends JpaBaseEntity implements Serializable {
|
|||||||
builder.append(description);
|
builder.append(description);
|
||||||
builder.append(", logo=");
|
builder.append(", logo=");
|
||||||
builder.append(logo);
|
builder.append(logo);
|
||||||
builder.append(", frontTitle=");
|
|
||||||
builder.append(frontTitle);
|
|
||||||
builder.append(", consoleTitle=");
|
|
||||||
builder.append(consoleTitle);
|
|
||||||
builder.append(", domain=");
|
builder.append(", domain=");
|
||||||
builder.append(domain);
|
builder.append(domain);
|
||||||
builder.append(", captchaType=");
|
builder.append(", frontTitle=");
|
||||||
builder.append(captchaType);
|
builder.append(frontTitle);
|
||||||
builder.append(", captchaSupport=");
|
builder.append(", consoleDomain=");
|
||||||
builder.append(captchaSupport);
|
builder.append(consoleDomain);
|
||||||
|
builder.append(", consoleTitle=");
|
||||||
|
builder.append(consoleTitle);
|
||||||
|
builder.append(", captcha=");
|
||||||
|
builder.append(captcha);
|
||||||
builder.append(", defaultUri=");
|
builder.append(", defaultUri=");
|
||||||
builder.append(defaultUri);
|
builder.append(defaultUri);
|
||||||
builder.append("]");
|
builder.append("]");
|
||||||
|
|||||||
@ -96,8 +96,7 @@ public class InstitutionsRepository {
|
|||||||
institution.setFrontTitle(rs.getString("fronttitle"));
|
institution.setFrontTitle(rs.getString("fronttitle"));
|
||||||
institution.setConsoleDomain(rs.getString("consoledomain"));
|
institution.setConsoleDomain(rs.getString("consoledomain"));
|
||||||
institution.setConsoleTitle(rs.getString("consoletitle"));
|
institution.setConsoleTitle(rs.getString("consoletitle"));
|
||||||
institution.setCaptchaType(rs.getString("captchatype"));
|
institution.setCaptcha(rs.getString("captcha"));
|
||||||
institution.setCaptchaSupport(rs.getString("captchasupport"));
|
|
||||||
institution.setDefaultUri(rs.getString("defaultUri"));
|
institution.setDefaultUri(rs.getString("defaultUri"));
|
||||||
return institution;
|
return institution;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,6 @@ export class Institutions extends BaseEntity {
|
|||||||
consoleTitle!: String;
|
consoleTitle!: String;
|
||||||
consoleDomain!: String;
|
consoleDomain!: String;
|
||||||
domain!: String;
|
domain!: String;
|
||||||
captchaType!: String;
|
captcha!: String;
|
||||||
captchaSupport!: String;
|
|
||||||
defaultUri!: String;
|
defaultUri!: String;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,26 +64,16 @@
|
|||||||
name="consoleTitle" id="consoleTitle" />
|
name="consoleTitle" id="consoleTitle" />
|
||||||
</nz-form-control>
|
</nz-form-control>
|
||||||
</nz-form-item>
|
</nz-form-item>
|
||||||
<nz-form-item>
|
|
||||||
<nz-form-label [nzMd]="6" nzFor="captchaSupport">{{ 'mxk.institutions.captchaSupport' | i18n }}</nz-form-label>
|
|
||||||
<nz-form-control [nzMd]="18" nzErrorTip="The input is not valid captchaSupport!">
|
|
||||||
<nz-radio-group [(ngModel)]="form.model.captchaSupport" [ngModelOptions]="{ standalone: true }"
|
|
||||||
nzButtonStyle="solid">
|
|
||||||
<label nz-radio-button nzValue="YES">{{ 'mxk.text.yes' | i18n }}</label>
|
|
||||||
<label nz-radio-button nzValue="NO">{{ 'mxk.text.no' | i18n }}</label>
|
|
||||||
</nz-radio-group>
|
|
||||||
</nz-form-control>
|
|
||||||
</nz-form-item>
|
|
||||||
<nz-form-item>
|
<nz-form-item>
|
||||||
<nz-form-label [nzMd]="6" nzFor="captchaType">{{ 'mxk.institutions.captchaType' | i18n }}</nz-form-label>
|
<nz-form-label [nzMd]="6" nzFor="captchaType">{{ 'mxk.institutions.captchaType' | i18n }}</nz-form-label>
|
||||||
<nz-form-control [nzMd]="18" nzErrorTip="The input is not valid captchaType!">
|
<nz-form-control [nzMd]="18" nzErrorTip="The input is not valid captchaType!">
|
||||||
<nz-select [(ngModel)]="form.model.captchaType" [ngModelOptions]="{ standalone: true }">
|
<nz-select [(ngModel)]="form.model.captcha" [ngModelOptions]="{ standalone: true }">
|
||||||
|
<nz-option nzValue="NONE" nzLabel="{{ 'mxk.institutions.captchaType.none' | i18n }}"></nz-option>
|
||||||
<nz-option nzValue="TEXT" nzLabel="{{ 'mxk.institutions.captchaType.text' | i18n }}"></nz-option>
|
<nz-option nzValue="TEXT" nzLabel="{{ 'mxk.institutions.captchaType.text' | i18n }}"></nz-option>
|
||||||
<nz-option nzValue="ARITHMETIC" nzLabel="{{ 'mxk.institutions.captchaType.arithmetic' | i18n }}"></nz-option>
|
<nz-option nzValue="ARITHMETIC" nzLabel="{{ 'mxk.institutions.captchaType.arithmetic' | i18n }}"></nz-option>
|
||||||
</nz-select>
|
</nz-select>
|
||||||
</nz-form-control>
|
</nz-form-control>
|
||||||
</nz-form-item>
|
</nz-form-item>
|
||||||
|
|
||||||
<nz-form-item>
|
<nz-form-item>
|
||||||
<nz-form-label [nzMd]="6" nzFor="contact">{{ 'mxk.institutions.contact' | i18n }}</nz-form-label>
|
<nz-form-label [nzMd]="6" nzFor="contact">{{ 'mxk.institutions.contact' | i18n }}</nz-form-label>
|
||||||
<nz-form-control [nzMd]="18" nzErrorTip="The input is not valid contact!">
|
<nz-form-control [nzMd]="18" nzErrorTip="The input is not valid contact!">
|
||||||
|
|||||||
@ -43,6 +43,7 @@
|
|||||||
<nz-option nzValue="company" nzLabel="{{ 'mxk.organizations.type.company' | i18n }}"></nz-option>
|
<nz-option nzValue="company" nzLabel="{{ 'mxk.organizations.type.company' | i18n }}"></nz-option>
|
||||||
<nz-option nzValue="division" nzLabel="{{ 'mxk.organizations.type.division' | i18n }}"></nz-option>
|
<nz-option nzValue="division" nzLabel="{{ 'mxk.organizations.type.division' | i18n }}"></nz-option>
|
||||||
<nz-option nzValue="department" nzLabel="{{ 'mxk.organizations.type.department' | i18n }}"></nz-option>
|
<nz-option nzValue="department" nzLabel="{{ 'mxk.organizations.type.department' | i18n }}"></nz-option>
|
||||||
|
<nz-option nzValue="team" nzLabel="{{ 'mxk.organizations.type.team' | i18n }}"></nz-option>
|
||||||
<nz-option nzValue="entity" nzLabel="{{ 'mxk.organizations.type.entity' | i18n }}"></nz-option>
|
<nz-option nzValue="entity" nzLabel="{{ 'mxk.organizations.type.entity' | i18n }}"></nz-option>
|
||||||
<nz-option nzValue="virtual" nzLabel="{{ 'mxk.organizations.type.virtual' | i18n }}"></nz-option>
|
<nz-option nzValue="virtual" nzLabel="{{ 'mxk.organizations.type.virtual' | i18n }}"></nz-option>
|
||||||
</nz-select>
|
</nz-select>
|
||||||
|
|||||||
@ -193,6 +193,7 @@
|
|||||||
"type.company": "Company",
|
"type.company": "Company",
|
||||||
"type.division": "Division",
|
"type.division": "Division",
|
||||||
"type.department": "Department",
|
"type.department": "Department",
|
||||||
|
"type.team": "Team",
|
||||||
"type.entity": "Entity",
|
"type.entity": "Entity",
|
||||||
"type.virtual": "Virtual",
|
"type.virtual": "Virtual",
|
||||||
"codePath": "Code Path",
|
"codePath": "Code Path",
|
||||||
@ -502,6 +503,7 @@
|
|||||||
"consoleTitle": "Console Title",
|
"consoleTitle": "Console Title",
|
||||||
"consoleDomain": "Console Domain",
|
"consoleDomain": "Console Domain",
|
||||||
"captchaType": "Captcha Type",
|
"captchaType": "Captcha Type",
|
||||||
|
"captchaType.none": "None",
|
||||||
"captchaType.text": "Text",
|
"captchaType.text": "Text",
|
||||||
"captchaType.arithmetic": "Arithmetic",
|
"captchaType.arithmetic": "Arithmetic",
|
||||||
"captchaSupport": "Captcha Support",
|
"captchaSupport": "Captcha Support",
|
||||||
|
|||||||
@ -194,6 +194,7 @@
|
|||||||
"type.company": "公司",
|
"type.company": "公司",
|
||||||
"type.division": "分支机构",
|
"type.division": "分支机构",
|
||||||
"type.department": "部门",
|
"type.department": "部门",
|
||||||
|
"type.team": "组",
|
||||||
"type.entity": "实体",
|
"type.entity": "实体",
|
||||||
"type.virtual": "虚拟",
|
"type.virtual": "虚拟",
|
||||||
"codePath": "编码路径",
|
"codePath": "编码路径",
|
||||||
@ -500,6 +501,7 @@
|
|||||||
"consoleDomain": "控制台域名",
|
"consoleDomain": "控制台域名",
|
||||||
"consoleTitle": "控制台名称",
|
"consoleTitle": "控制台名称",
|
||||||
"captchaType": "验证码",
|
"captchaType": "验证码",
|
||||||
|
"captchaType.none": "无",
|
||||||
"captchaType.text": "字符",
|
"captchaType.text": "字符",
|
||||||
"captchaType.arithmetic": "算术",
|
"captchaType.arithmetic": "算术",
|
||||||
"captchaSupport": "验证码支持",
|
"captchaSupport": "验证码支持",
|
||||||
|
|||||||
@ -195,6 +195,7 @@
|
|||||||
"type.company": "公司",
|
"type.company": "公司",
|
||||||
"type.division": "分支機搆",
|
"type.division": "分支機搆",
|
||||||
"type.department": "部門",
|
"type.department": "部門",
|
||||||
|
"type.team": "組",
|
||||||
"type.entity": "實體",
|
"type.entity": "實體",
|
||||||
"type.virtual": "虛擬",
|
"type.virtual": "虛擬",
|
||||||
"codePath": "編碼路徑",
|
"codePath": "編碼路徑",
|
||||||
@ -501,6 +502,7 @@
|
|||||||
"consoleDomain": "控制台域名",
|
"consoleDomain": "控制台域名",
|
||||||
"consoleTitle": "控制台名稱",
|
"consoleTitle": "控制台名稱",
|
||||||
"captchaType": "驗證碼",
|
"captchaType": "驗證碼",
|
||||||
|
"captchaType.none": "無",
|
||||||
"captchaType.text": "字符",
|
"captchaType.text": "字符",
|
||||||
"captchaType.arithmetic": "算術",
|
"captchaType.arithmetic": "算術",
|
||||||
"captchaSupport": "驗證碼支持",
|
"captchaSupport": "驗證碼支持",
|
||||||
|
|||||||
@ -142,8 +142,7 @@ public class LoginEntryPoint {
|
|||||||
if(applicationConfig.getLoginConfig().isCaptcha()) {
|
if(applicationConfig.getLoginConfig().isCaptcha()) {
|
||||||
model.put("captcha", "true");
|
model.put("captcha", "true");
|
||||||
}else {
|
}else {
|
||||||
model.put("captcha", inst.getCaptchaSupport());
|
model.put("captcha", inst.getCaptcha());
|
||||||
model.put("captchaType", inst.getCaptchaType());
|
|
||||||
}
|
}
|
||||||
model.put("state", authTokenService.genRandomJwt());
|
model.put("state", authTokenService.genRandomJwt());
|
||||||
//load Social Sign On Providers
|
//load Social Sign On Providers
|
||||||
|
|||||||
@ -72,8 +72,7 @@ public class LoginEntryPoint {
|
|||||||
if(applicationConfig.getLoginConfig().isCaptcha()) {
|
if(applicationConfig.getLoginConfig().isCaptcha()) {
|
||||||
model.put("captcha", "true");
|
model.put("captcha", "true");
|
||||||
}else {
|
}else {
|
||||||
model.put("captcha", inst.getCaptchaSupport());
|
model.put("captcha", inst.getCaptcha());
|
||||||
model.put("captchaType", inst.getCaptchaType());
|
|
||||||
}
|
}
|
||||||
model.put("state", authTokenService.genRandomJwt());
|
model.put("state", authTokenService.genRandomJwt());
|
||||||
return new Message<HashMap<String , Object>>(model).buildResponse();
|
return new Message<HashMap<String , Object>>(model).buildResponse();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user