mirror of https://github.com/certd/certd
chore:
parent
c6fff4950d
commit
92c6c45e77
|
@ -12,6 +12,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ComponentPropsType, doRequest } from "/@/components/plugins/lib";
|
||||
import { ref, inject } from "vue";
|
||||
import { Form } from "ant-design-vue";
|
||||
|
||||
defineOptions({
|
||||
name: "ApiTest"
|
||||
|
@ -19,7 +20,7 @@ defineOptions({
|
|||
|
||||
const getScope: any = inject("get:scope");
|
||||
const getPluginType: any = inject("get:plugin:type");
|
||||
|
||||
const formItemContext = Form.useInjectFormItemContext();
|
||||
const props = defineProps<{} & ComponentPropsType>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
@ -34,13 +35,14 @@ const doTest = async () => {
|
|||
return;
|
||||
}
|
||||
|
||||
formItemContext.onFieldChange();
|
||||
|
||||
const { form } = getScope();
|
||||
const pluginType = getPluginType();
|
||||
|
||||
message.value = "";
|
||||
hasError.value = false;
|
||||
loading.value = true;
|
||||
debugger;
|
||||
try {
|
||||
const res = await doRequest(
|
||||
{
|
||||
|
|
|
@ -47,6 +47,13 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
|||
//eval
|
||||
useReference(column);
|
||||
|
||||
if (column.required) {
|
||||
if (!column.rules) {
|
||||
column.rules = [];
|
||||
}
|
||||
column.rules.push({ required: true, message: "此项必填" });
|
||||
}
|
||||
|
||||
//设置默认值
|
||||
if (column.value != null && get(form, key) == null) {
|
||||
set(form, key, column.value);
|
||||
|
|
|
@ -38,6 +38,13 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
|
|||
//eval
|
||||
useReference(column);
|
||||
|
||||
if (column.required) {
|
||||
if (!column.rules) {
|
||||
column.rules = [];
|
||||
}
|
||||
column.rules.push({ required: true, message: "此项必填" });
|
||||
}
|
||||
|
||||
//设置默认值
|
||||
if (column.value != null && get(form, key) == null) {
|
||||
set(form, key, column.value);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { ALL, Body, Controller, Inject, Post, Provide } from '@midwayjs/core';
|
||||
import { Constants } from '@certd/lib-server';
|
||||
import { BaseController, Constants } from '@certd/lib-server';
|
||||
import {
|
||||
AccessRequestHandleReq,
|
||||
ITaskPlugin,
|
||||
|
@ -10,7 +10,6 @@ import {
|
|||
PluginRequestHandleReq,
|
||||
TaskInstanceContext,
|
||||
} from '@certd/pipeline';
|
||||
import { BaseController } from '@certd/lib-server';
|
||||
import { AccessService } from '../../modules/pipeline/service/access-service.js';
|
||||
import { EmailService } from '../../modules/basic/service/email-service.js';
|
||||
import { AccessGetter } from '../../modules/pipeline/service/access-getter.js';
|
||||
|
|
|
@ -57,6 +57,10 @@ export class EmailService implements IEmailService {
|
|||
async send(email: EmailSend) {
|
||||
logger.info('sendEmail', email);
|
||||
|
||||
if (!email.receivers || email.receivers.length === 0) {
|
||||
throw new Error('收件人不能为空');
|
||||
}
|
||||
|
||||
const emailConf = await getEmailSettings(this.sysSettingsService, this.settingsService);
|
||||
|
||||
if (!emailConf.host && emailConf.usePlus == null) {
|
||||
|
|
|
@ -30,8 +30,9 @@ export class QywxNotification extends BaseNotification {
|
|||
mentionedList!: string[];
|
||||
|
||||
async send(body: NotificationBody) {
|
||||
console.log('send qywx');
|
||||
|
||||
if (!this.webhook) {
|
||||
throw new Error('webhook地址不能为空');
|
||||
}
|
||||
/**
|
||||
*
|
||||
* "msgtype": "text",
|
||||
|
|
Loading…
Reference in New Issue