mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
feat: 域名验证方法支持CNAME间接方式,此方式支持所有域名注册商,且无需提供Access授权,但是需要手动添加cname解析
This commit is contained in:
@@ -68,9 +68,13 @@ function install(app: App, options: any = {}) {
|
||||
},
|
||||
conditionalRender: {
|
||||
match(scope) {
|
||||
if (scope.column.conditionalRenderDisabled) {
|
||||
return false;
|
||||
}
|
||||
if (scope.key === "__blank__") {
|
||||
return false;
|
||||
}
|
||||
|
||||
//不能用 !scope.value , 否则switch组件设置为关之后就消失了
|
||||
const { value, key, props } = scope;
|
||||
return !value && key != "_index" && value != false;
|
||||
@@ -349,8 +353,8 @@ function install(app: App, options: any = {}) {
|
||||
columnProps.column = {};
|
||||
}
|
||||
columnProps.column.resizable = true;
|
||||
if (!columnProps.column.width) {
|
||||
columnProps.column.width = -1;
|
||||
if (columnProps.column.width == null) {
|
||||
columnProps.column.width = 200;
|
||||
} else if (typeof columnProps.column?.width === "string" && columnProps.column.width.indexOf("px") > -1) {
|
||||
columnProps.column.width = parseInt(columnProps.column.width.replace("px", ""));
|
||||
}
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
import Validator from "async-validator";
|
||||
// 自定义验证器函数
|
||||
function isDomain(rule, value, callback) {
|
||||
function isDomain(rule, value) {
|
||||
if (value == null) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
let domains: string[] = value;
|
||||
if (typeof value === "string") {
|
||||
domains = value.split(",");
|
||||
}
|
||||
for (const domain of domains) {
|
||||
//域名可以是泛域名,中文域名,数字域名,英文域名,域名中可以包含-和.
|
||||
if (!/^(?:[0-9a-zA-Z\u4e00-\u9fa5-]+\.)+[0-9a-zA-Z\u4e00-\u9fa5-]+$/.test(domain)) {
|
||||
callback(new Error(`域名有误:${domain},请输入正确的域名`));
|
||||
//域名可以是泛域名,中文域名,数字域名,英文域名,域名中可以包含-和. ,可以_开头
|
||||
if (!/^(?:\*\.|[0-9a-zA-Z\u4e00-\u9fa5-]+\.)+[0-9a-zA-Z\u4e00-\u9fa5-]+$/.test(domain)) {
|
||||
throw new Error(`域名有误:${domain},请输入正确的域名`);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// 注册自定义验证器
|
||||
Validator.register("domains", isDomain);
|
||||
|
||||
Reference in New Issue
Block a user