diff --git a/docs/guide/development/index.md b/docs/guide/development/index.md index 804c9979..bf65c2d5 100644 --- a/docs/guide/development/index.md +++ b/docs/guide/development/index.md @@ -14,9 +14,6 @@ git clone https://github.com/certd/certd --depth=1 #进入项目目录 cd certd -# 切换到最新版本代码【如果v2分支无法编译,请尝试切换到最新版tag】 -# git checkout v1.27.0 # 这里换成最新版本号 - ``` ### 修改pnpm-workspace.yaml文件 diff --git a/packages/ui/certd-client/src/views/sys/settings/email/index.vue b/packages/ui/certd-client/src/views/sys/settings/email/index.vue index f351a189..955f7cb4 100644 --- a/packages/ui/certd-client/src/views/sys/settings/email/index.vue +++ b/packages/ui/certd-client/src/views/sys/settings/email/index.vue @@ -65,6 +65,7 @@ +
保存后再点击测试
发送失败???邮件配置帮助文档
您还可以试试使用官方邮件服务器↗↗↗↗↗↗↗↗
diff --git a/packages/ui/certd-server/src/modules/basic/service/email-service.ts b/packages/ui/certd-server/src/modules/basic/service/email-service.ts index e4985680..b6fe0979 100644 --- a/packages/ui/certd-server/src/modules/basic/service/email-service.ts +++ b/packages/ui/certd-server/src/modules/basic/service/email-service.ts @@ -3,12 +3,12 @@ import type { EmailSend } from '@certd/pipeline'; import { IEmailService } from '@certd/pipeline'; import { logger } from '@certd/basic'; -import { isPlus } from '@certd/plus-core'; +import { isComm, isPlus } from '@certd/plus-core'; import nodemailer from 'nodemailer'; import type SMTPConnection from 'nodemailer/lib/smtp-connection'; import { UserSettingsService } from '../../mine/service/user-settings-service.js'; -import { PlusService, SysSettingsService } from '@certd/lib-server'; +import { PlusService, SysSettingsService, SysSiteInfo } from '@certd/lib-server'; import { getEmailSettings } from '../../sys/settings/fix.js'; export type EmailConfig = { @@ -80,8 +80,16 @@ export class EmailService implements IEmailService { private async sendByCustom(emailConfig: EmailConfig, email: EmailSend) { const transporter = nodemailer.createTransport(emailConfig); + + let sysTitle = 'Certd'; + if (isComm()) { + const siteInfo = await this.sysSettingsService.getSetting(SysSiteInfo); + if (siteInfo) { + sysTitle = siteInfo.title || sysTitle; + } + } const mailOptions = { - from: emailConfig.sender, + from: `${sysTitle} <${emailConfig.sender}>`, to: email.receivers.join(', '), // list of receivers subject: email.subject, text: email.content, diff --git a/packages/ui/certd-server/src/plugins/plugin-demo/plugins/plugin-test.ts b/packages/ui/certd-server/src/plugins/plugin-demo/plugins/plugin-test.ts index 5af60c64..f2cd8735 100644 --- a/packages/ui/certd-server/src/plugins/plugin-demo/plugins/plugin-test.ts +++ b/packages/ui/certd-server/src/plugins/plugin-demo/plugins/plugin-test.ts @@ -4,18 +4,21 @@ import { createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from import { optionsUtils } from '@certd/basic/dist/utils/util.options.js'; @IsTaskPlugin({ - name: 'demoTest', + //命名规范,插件名称+功能(就是目录plugin-demo中的demo),大写字母开头,驼峰命名 + name: 'DemoTest', title: 'Demo测试插件', icon: 'clarity:plugin-line', //插件分组 group: pluginGroups.other.key, default: { + //默认值配置照抄即可 strategy: { runStrategy: RunStrategy.SkipWhenSucceed, }, }, }) -export class DemoTestPlugin extends AbstractTaskPlugin { +//类名规范,跟上面插件名称(name)一致 +export class DemoTest extends AbstractTaskPlugin { //测试参数 @TaskInput({ title: '属性示例', @@ -42,6 +45,23 @@ export class DemoTestPlugin extends AbstractTaskPlugin { }) select!: string; + //测试参数 + @TaskInput({ + title: '多选框', + component: { + //前端组件配置,具体配置见组件文档 https://www.antdv.com/components/select-cn + name: 'a-select', + vModel: 'value', + mode: 'tags', + multiple: true, + options: [ + { value: '1', label: '选项1' }, + { value: '2', label: '选项2' }, + ], + }, + }) + multiSelect!: string; + //测试参数 @TaskInput({ title: 'switch', @@ -85,8 +105,7 @@ export class DemoTestPlugin extends AbstractTaskPlugin { createRemoteSelectInputDefine({ title: '从后端获取选项', helper: '选择时可以从后端获取选项', - typeName: 'demoTest', - action: DemoTestPlugin.prototype.onGetSiteList.name, + action: DemoTest.prototype.onGetSiteList.name, //当以下参数变化时,触发获取选项 watches: ['certDomains', 'accessId'], required: true, @@ -121,15 +140,15 @@ export class DemoTestPlugin extends AbstractTaskPlugin { this.logger.info('switch:', this.switch); this.logger.info('授权id:', accessId); - const res = await this.http.request({ - url: 'https://api.demo.com', - method: 'GET', - }); - if (res.code !== 0) { - //检查res是否报错,你需要抛异常,来结束插件执行,否则会判定为执行成功,下次执行时会跳过本任务 - throw new Error(res.message); - } - this.logger.info('部署成功:', res); + // const res = await this.http.request({ + // url: 'https://api.demo.com', + // method: 'GET', + // }); + // if (res.code !== 0) { + // //检查res是否报错,你需要抛异常,来结束插件执行,否则会判定为执行成功,下次执行时会跳过本任务 + // throw new Error(res.message); + // } + // this.logger.info('部署成功:', res); } //此方法演示,如何让前端在添加插件时可以从后端获取选项,这里是后端返回选项的方法 @@ -167,4 +186,4 @@ export class DemoTestPlugin extends AbstractTaskPlugin { } } //实例化一下,注册插件 -new DemoTestPlugin(); +new DemoTest();