|
|
@@ -0,0 +1,203 @@
|
|
|
+import type { VbenFormSchema } from '@vben/common-ui';
|
|
|
+
|
|
|
+import { h } from 'vue';
|
|
|
+
|
|
|
+import { EnumApi } from '#/api';
|
|
|
+
|
|
|
+export const useSmsSchema = (): VbenFormSchema[] => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: '请输入短信测试',
|
|
|
+ },
|
|
|
+ fieldName: 'testCode',
|
|
|
+ label: '短信测试',
|
|
|
+ rules: 'required',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'BcRadio',
|
|
|
+ componentProps: {
|
|
|
+ api: {
|
|
|
+ type: 'enum',
|
|
|
+ params: EnumApi.EnumType.Provider,
|
|
|
+ },
|
|
|
+ isBtn: true,
|
|
|
+ },
|
|
|
+ fieldName: 'provider',
|
|
|
+ label: '短信服务商',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: 'AccessKey ID',
|
|
|
+ },
|
|
|
+ fieldName: 'accessKeyId',
|
|
|
+ label: 'AccessKey',
|
|
|
+ // rules: 'required',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: 'SecretKey Secret',
|
|
|
+ },
|
|
|
+ fieldName: 'accessKeySecret',
|
|
|
+ label: 'SecretKey',
|
|
|
+ // rules: 'required',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: '短信SDKAPPID,示例值:1400006666',
|
|
|
+ },
|
|
|
+
|
|
|
+ dependencies: {
|
|
|
+ triggerFields: ['provider'],
|
|
|
+ show(values) {
|
|
|
+ return [1].includes(values.provider);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ fieldName: 'sdkAppId',
|
|
|
+ label: '短信SdkAppId',
|
|
|
+ // rules: 'required',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: h('div', { class: 'text-sm font-thin' }, [
|
|
|
+ h(
|
|
|
+ 'div',
|
|
|
+ null,
|
|
|
+ '短信服务商的不同,模板的格式不同,请注意修改系统通知模板;',
|
|
|
+ ),
|
|
|
+ h(
|
|
|
+ 'div',
|
|
|
+ null,
|
|
|
+ '短信的签名、模板,请在相关的平台设置和获取,审核后才可使用;',
|
|
|
+ ),
|
|
|
+ h('div', null, '修改短信账户信息后,请保存成功后再进行发送测试短信;'),
|
|
|
+ h(
|
|
|
+ 'div',
|
|
|
+ null,
|
|
|
+ '测试短信的模板变量,阿里云格式如:{"参数名","值"},腾讯云如:值1,值2',
|
|
|
+ ),
|
|
|
+ ]),
|
|
|
+ formItemClass: 'items-start',
|
|
|
+ fieldName: 'remark',
|
|
|
+ label: '填写说明',
|
|
|
+ },
|
|
|
+ ];
|
|
|
+};
|
|
|
+
|
|
|
+export const useEmailSchema = (): VbenFormSchema[] => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ component: 'Switch',
|
|
|
+ fieldName: 'enableSsl',
|
|
|
+ label: 'SSL加密连接',
|
|
|
+ rules: 'required',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: '请输入显示字数',
|
|
|
+ class: 'w-auto',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: '发送邮件的SMTP服务器地址',
|
|
|
+ },
|
|
|
+ fieldName: 'host',
|
|
|
+ label: 'SMTP服务器',
|
|
|
+ rules: 'required',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: 'SMTP服务器端口,一般是25',
|
|
|
+ },
|
|
|
+ fieldName: 'host',
|
|
|
+ label: 'SMTP端口',
|
|
|
+ rules: 'required',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: '发件人邮箱地址',
|
|
|
+ },
|
|
|
+ fieldName: 'emailFrom',
|
|
|
+ label: '发件人地址',
|
|
|
+ rules: 'required',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: '发件人邮箱账号',
|
|
|
+ },
|
|
|
+ fieldName: 'userName',
|
|
|
+ label: '邮箱账号',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'InputPassword',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: '发件人邮箱密码',
|
|
|
+ },
|
|
|
+ fieldName: 'password',
|
|
|
+ label: '邮箱密码',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: '发件人发件人呢称',
|
|
|
+ },
|
|
|
+ fieldName: 'nickName',
|
|
|
+ label: '发件人呢称',
|
|
|
+ rules: 'required',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'Switch',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: '启用错误日志发送邮箱',
|
|
|
+ class: 'w-auto',
|
|
|
+ },
|
|
|
+ fieldName: 'useError',
|
|
|
+ label: '启用错误日志发送邮箱',
|
|
|
+ rules: 'required',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: 'Input',
|
|
|
+ componentProps: {
|
|
|
+ placeholder: '启用错误日志发送邮箱',
|
|
|
+ },
|
|
|
+ fieldName: 'emailTo',
|
|
|
+ label: '接收错误日志的邮箱',
|
|
|
+ rules: 'required',
|
|
|
+ dependencies: {
|
|
|
+ triggerFields: ['useError'],
|
|
|
+ show(values) {
|
|
|
+ return values.useError;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ component: h('div', { class: 'text-sm font-thin' }, [
|
|
|
+ h(
|
|
|
+ 'div',
|
|
|
+ null,
|
|
|
+ '短信服务商的不同,模板的格式不同,请注意修改系统通知模板;',
|
|
|
+ ),
|
|
|
+ h(
|
|
|
+ 'div',
|
|
|
+ null,
|
|
|
+ '短信的签名、模板,请在相关的平台设置和获取,审核后才可使用;',
|
|
|
+ ),
|
|
|
+ h('div', null, '修改短信账户信息后,请保存成功后再进行发送测试短信;'),
|
|
|
+ h(
|
|
|
+ 'div',
|
|
|
+ null,
|
|
|
+ '测试短信的模板变量,阿里云格式如:{"参数名","值"},腾讯云如:值1,值2',
|
|
|
+ ),
|
|
|
+ ]),
|
|
|
+ formItemClass: 'items-start',
|
|
|
+ fieldName: 'remark',
|
|
|
+ label: '填写说明',
|
|
|
+ },
|
|
|
+ ];
|
|
|
+};
|