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