pull/213/head
xiaojunnuo 2024-10-10 22:13:07 +08:00
parent 50173aa265
commit a6fb15f81b
5 changed files with 20 additions and 8 deletions

View File

@ -49,12 +49,12 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
vModel: "value",
options: [
{ value: "dns", label: "DNS直接验证" },
{ value: "cname", label: "CNAME间接验证" },
{ value: "cname", label: "CNAME代理验证" },
],
},
required: true,
helper:
"DNS直接验证适合域名是在阿里云、腾讯云、华为云、Cloudflare、西数注册的需要提供Access授权信息。\nCNAME间接验证支持任何注册商注册的域名并且不需要提供Access授权信息但第一次需要手动添加CNAME记录",
"DNS直接验证适合域名是在阿里云、腾讯云、华为云、Cloudflare、西数注册的需要提供Access授权信息。\nCNAME代理验证支持任何注册商注册的域名并且不需要提供Access授权信息但第一次需要手动添加CNAME记录",
})
challengeType!: string;
@ -71,7 +71,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
}
`,
required: true,
helper: "请选择dns解析提供商您的域名是在哪里注册的或者域名的dns解析服务器属于哪个平台\n如果这里没有您需要的dns解析提供商请选择CNAME间接验证校验方式",
helper: "请选择dns解析提供商您的域名是在哪里注册的或者域名的dns解析服务器属于哪个平台\n如果这里没有您需要的dns解析提供商请选择CNAME代理验证校验方式",
})
dnsProviderType!: string;

View File

@ -84,7 +84,10 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}
},
form: {
helper: "CNAME域名一旦确定不可修改",
component: {
placeholder: "cname.handsfree.work"
},
helper: "CNAME域名一旦确定不可修改建议使用一级子域名",
rules: [{ required: true, message: "此项必填" }]
},
column: {

View File

@ -23,7 +23,7 @@ import { onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "/@/views/certd/history/api";
import { DeleteBatch } from "./api";
defineOptions({
name: "CnameProvider"

View File

@ -52,6 +52,12 @@ export class CnameRecordController extends CrudController<CnameProviderService>
return super.delete(id);
}
@Post('/deleteByIds', { summary: 'sys:settings:edit' })
async deleteByIds(@Body(ALL) body: { ids: number[] }) {
const res = await this.service.delete(body.ids);
return this.ok(res);
}
@Post('/setDefault', { summary: 'sys:settings:edit' })
async setDefault(@Body('id') id: number) {
await this.service.setDefault(id);

View File

@ -49,6 +49,9 @@ export class CnameProviderService extends BaseService<CnameProviderEntity> {
}
async delete(ids: any) {
if (!ids) {
return;
}
if (!(ids instanceof Array)) {
ids = [ids];
}
@ -77,9 +80,9 @@ export class CnameProviderService extends BaseService<CnameProviderEntity> {
if (def) {
return def;
}
const found = await this.repository.findOne({ order: { createTime: 'DESC' } });
if (found) {
return found;
const founds = await this.repository.find({ take: 1, order: { createTime: 'DESC' } });
if (founds && founds.length > 0) {
return founds[0];
}
return null;
}