短信配置 增加天翼云
This commit is contained in:
parent
b25d954f6b
commit
7b601ff11f
|
|
@ -7,7 +7,7 @@ import {
|
|||
Config,
|
||||
QiniuCloudConfig,
|
||||
TencentCloudConfig,
|
||||
CTYunConfig
|
||||
CTYunCloudConfig,
|
||||
} from '../../../../types/Config';
|
||||
|
||||
|
||||
|
|
@ -369,7 +369,7 @@ function QiniuAccount(props: {
|
|||
}
|
||||
|
||||
function CTYunAccount(props: {
|
||||
accounts: CTYunConfig[];
|
||||
accounts: CTYunCloudConfig[];
|
||||
setValue: (path: string, value: any) => void;
|
||||
removeItem: (path: string, index: number) => void;
|
||||
addItem: (path: string, index: number) => void;
|
||||
|
|
@ -423,17 +423,17 @@ function CTYunAccount(props: {
|
|||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="secretKey"
|
||||
// name="secretKey"
|
||||
label="securityKey"
|
||||
// name="securityKey"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入secretKey"
|
||||
placeholder="请输入securityKey"
|
||||
type="text"
|
||||
value={ele.secretKey}
|
||||
value={ele.securityKey}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.secretKey`,
|
||||
`${idx}.securityKey`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
|
|
@ -473,17 +473,17 @@ function CTYunAccount(props: {
|
|||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="secretKey"
|
||||
// name="secretKey"
|
||||
label="securityKey"
|
||||
// name="securityKey"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入secretKey"
|
||||
placeholder="请输入securityKey"
|
||||
type="text"
|
||||
value=""
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`0.secretKey`,
|
||||
`0.securityKey`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {
|
|||
} from 'antd';
|
||||
import { get } from 'oak-domain/lib/utils/lodash';
|
||||
import Styles from './web.module.less';
|
||||
import { Config, AliSmsConfig, TencentSmsConfig } from '../../../../types/Config';
|
||||
import { Config, AliSmsConfig, TencentSmsConfig, CTYunSmsConfig } from '../../../../types/Config';
|
||||
|
||||
|
||||
function Ali(props: {
|
||||
|
|
@ -50,52 +50,106 @@ function Ali(props: {
|
|||
items={
|
||||
sms.length > 0
|
||||
? sms.map((ele, idx) => ({
|
||||
key: `${idx}`,
|
||||
label: `短信${idx + 1}`,
|
||||
children: (
|
||||
<Form
|
||||
colon={false}
|
||||
labelAlign="left"
|
||||
layout="vertical"
|
||||
style={{ marginTop: 10 }}
|
||||
>
|
||||
<Form.Item
|
||||
label="accessKeyId"
|
||||
name="accessKeyId"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入accessKeyId"
|
||||
type="text"
|
||||
value={ele.accessKeyId}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.accessKeyId`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="defaultSignName"
|
||||
name="defaultSignName"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入defaultSignName"
|
||||
type="text"
|
||||
value={ele.defaultSignName}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.defaultSignName`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
{/* <Form.Item
|
||||
key: `${idx}`,
|
||||
label: `短信${idx + 1}`,
|
||||
children: (
|
||||
<Form
|
||||
colon={false}
|
||||
labelAlign="left"
|
||||
layout="vertical"
|
||||
style={{ marginTop: 10 }}
|
||||
>
|
||||
<Form.Item
|
||||
label="accessKeyId"
|
||||
name="accessKeyId"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入accessKeyId"
|
||||
type="text"
|
||||
value={ele.accessKeyId}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.accessKeyId`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="accessKeySecret"
|
||||
name="accessKeySecret"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入accessKeySecret"
|
||||
type="text"
|
||||
value={ele.accessKeySecret}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.accessKeySecret`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="endpoint"
|
||||
name="endpoint"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入endpoint"
|
||||
type="text"
|
||||
value={ele.endpoint}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.endpoint`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="apiVersion"
|
||||
name="apiVersion"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入apiVersion"
|
||||
type="text"
|
||||
value={ele.apiVersion}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.defaultSignName`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="defaultSignName"
|
||||
name="defaultSignName"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入defaultSignName"
|
||||
type="text"
|
||||
value={ele.defaultSignName}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.defaultSignName`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
{/* <Form.Item
|
||||
label="templates"
|
||||
name="templates"
|
||||
>
|
||||
|
|
@ -199,9 +253,9 @@ function Ali(props: {
|
|||
}
|
||||
></Tabs>
|
||||
</Form.Item> */}
|
||||
</Form>
|
||||
),
|
||||
}))
|
||||
</Form>
|
||||
),
|
||||
}))
|
||||
: []
|
||||
}
|
||||
></Tabs>
|
||||
|
|
@ -297,176 +351,513 @@ function Tencent(props: {
|
|||
items={
|
||||
sms.length > 0
|
||||
? sms.map((ele, idx) => ({
|
||||
key: `${idx}`,
|
||||
label: `短信${idx + 1}`,
|
||||
children: (
|
||||
<Form
|
||||
colon={false}
|
||||
labelAlign="left"
|
||||
layout="vertical"
|
||||
style={{ marginTop: 10 }}
|
||||
>
|
||||
<Form.Item
|
||||
label="secretId"
|
||||
//name="secretId"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入secretId"
|
||||
type="text"
|
||||
value={ele.secretId}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.secretId`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="smsSdkAppId"
|
||||
//name="smsSdkAppId"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入smsSdkAppId"
|
||||
type="text"
|
||||
value={ele.smsSdkAppId}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.smsSdkAppId`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="defaultSignName"
|
||||
//name="defaultSignName"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入defaultSignName"
|
||||
type="text"
|
||||
value={ele.defaultSignName}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.defaultSignName`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="templates"
|
||||
//name="templates"
|
||||
>
|
||||
<Tabs
|
||||
tabPosition={'top'}
|
||||
size={'middle'}
|
||||
type="editable-card"
|
||||
// hideAdd={!(Object.keys(ele.templates).length > 0)}
|
||||
onEdit={(
|
||||
targetKey: any,
|
||||
action: 'add' | 'remove'
|
||||
) => {
|
||||
if (action === 'add') {
|
||||
setSmsIndex(`${idx}`);
|
||||
setModal(true);
|
||||
} else {
|
||||
cleanKey(
|
||||
`${idx}.templates`,
|
||||
targetKey
|
||||
);
|
||||
}
|
||||
}}
|
||||
items={
|
||||
Object.keys(
|
||||
ele.templates || {}
|
||||
).length > 0
|
||||
? Object.keys(
|
||||
ele.templates
|
||||
).map((name, idx) => {
|
||||
const template =
|
||||
ele.templates[
|
||||
name
|
||||
];
|
||||
return {
|
||||
key: `${name}`,
|
||||
label: `${name}`,
|
||||
children: (
|
||||
<Form
|
||||
colon={
|
||||
true
|
||||
}
|
||||
labelAlign="left"
|
||||
layout="vertical"
|
||||
style={{
|
||||
marginTop: 10,
|
||||
}}
|
||||
>
|
||||
<Form.Item
|
||||
label="signName"
|
||||
//name="signName"
|
||||
key: `${idx}`,
|
||||
label: `短信${idx + 1}`,
|
||||
children: (
|
||||
<Form
|
||||
colon={false}
|
||||
labelAlign="left"
|
||||
layout="vertical"
|
||||
style={{ marginTop: 10 }}
|
||||
>
|
||||
<Form.Item
|
||||
label="secretId"
|
||||
//name="secretId"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入secretId"
|
||||
type="text"
|
||||
value={ele.secretId}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.secretId`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="secretKey"
|
||||
//name="secretId"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入secretKey"
|
||||
type="text"
|
||||
value={ele.secretKey}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.secretKey`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="smsSdkAppId"
|
||||
//name="smsSdkAppId"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入smsSdkAppId"
|
||||
type="text"
|
||||
value={ele.smsSdkAppId}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.smsSdkAppId`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="region"
|
||||
//name="region"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入region"
|
||||
type="text"
|
||||
value={ele.region}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.region`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="endpoint"
|
||||
//name="endpoint"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入endpoint"
|
||||
type="text"
|
||||
value={ele.endpoint}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.endpoint`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="defaultSignName"
|
||||
//name="defaultSignName"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入defaultSignName"
|
||||
type="text"
|
||||
value={ele.defaultSignName}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.defaultSignName`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="templates"
|
||||
//name="templates"
|
||||
>
|
||||
<Tabs
|
||||
tabPosition={'top'}
|
||||
size={'middle'}
|
||||
type="editable-card"
|
||||
// hideAdd={!(Object.keys(ele.templates).length > 0)}
|
||||
onEdit={(
|
||||
targetKey: any,
|
||||
action: 'add' | 'remove'
|
||||
) => {
|
||||
if (action === 'add') {
|
||||
setSmsIndex(`${idx}`);
|
||||
setModal(true);
|
||||
} else {
|
||||
cleanKey(
|
||||
`${idx}.templates`,
|
||||
targetKey
|
||||
);
|
||||
}
|
||||
}}
|
||||
items={
|
||||
Object.keys(
|
||||
ele.templates || {}
|
||||
).length > 0
|
||||
? Object.keys(
|
||||
ele.templates
|
||||
).map((name, idx) => {
|
||||
const template =
|
||||
ele.templates[
|
||||
name
|
||||
];
|
||||
return {
|
||||
key: `${name}`,
|
||||
label: `${name}`,
|
||||
children: (
|
||||
<Form
|
||||
colon={
|
||||
true
|
||||
}
|
||||
labelAlign="left"
|
||||
layout="vertical"
|
||||
style={{
|
||||
marginTop: 10,
|
||||
}}
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入signName"
|
||||
type="text"
|
||||
value={
|
||||
template.signName
|
||||
}
|
||||
onChange={(
|
||||
e
|
||||
) =>
|
||||
setValue(
|
||||
`${idx}.templates.${name}.signName`,
|
||||
<Form.Item
|
||||
label="signName"
|
||||
//name="signName"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入signName"
|
||||
type="text"
|
||||
value={
|
||||
template.signName
|
||||
}
|
||||
onChange={(
|
||||
e
|
||||
.target
|
||||
.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="code"
|
||||
//name="code"
|
||||
) =>
|
||||
setValue(
|
||||
`${idx}.templates.${name}.signName`,
|
||||
e
|
||||
.target
|
||||
.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="code"
|
||||
//name="code"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入code"
|
||||
type="text"
|
||||
value={
|
||||
template.code
|
||||
}
|
||||
onChange={(
|
||||
e
|
||||
) =>
|
||||
setValue(
|
||||
`${idx}.templates.${name}.code`,
|
||||
e
|
||||
.target
|
||||
.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
),
|
||||
};
|
||||
})
|
||||
: []
|
||||
}
|
||||
></Tabs>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
),
|
||||
}))
|
||||
: []
|
||||
}
|
||||
></Tabs>
|
||||
<Modal
|
||||
title="新建模版标签"
|
||||
onCancel={() => {
|
||||
setModal(false);
|
||||
setLabelType('');
|
||||
}}
|
||||
onOk={() => {
|
||||
if (!labelType) {
|
||||
message.error({
|
||||
content: '请输入标签名称',
|
||||
});
|
||||
return;
|
||||
}
|
||||
const templates = get(sms, `${smsIndex}.templates`) || {};
|
||||
if (Object.keys(templates).includes(labelType)) {
|
||||
message.error({
|
||||
content: '已存在相同的标签名,请重新输入',
|
||||
});
|
||||
return;
|
||||
}
|
||||
setValue(`${smsIndex}.templates.${labelType}`, {});
|
||||
setModal(false);
|
||||
setLabelType('');
|
||||
setSmsIndex('');
|
||||
}}
|
||||
open={open}
|
||||
cancelText="取消"
|
||||
okText="确定"
|
||||
destroyOnClose={true}
|
||||
>
|
||||
<Form
|
||||
colon={true}
|
||||
labelAlign="left"
|
||||
layout="vertical"
|
||||
style={{ marginTop: 10 }}
|
||||
>
|
||||
<Form.Item
|
||||
label="标签名称"
|
||||
//name="messageType"
|
||||
help="只能输入英文和中文"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入标签名称"
|
||||
type="text"
|
||||
value={labelType}
|
||||
onChange={(e) =>
|
||||
setLabelType(
|
||||
e.target.value.replace(/[0-9-.]/g, '')
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</Col>
|
||||
);
|
||||
}
|
||||
|
||||
function CTYun(props: {
|
||||
sms: CTYunSmsConfig[];
|
||||
setValue: (path: string, value: any) => void;
|
||||
removeItem: (path: string, index: number) => void;
|
||||
addItem: (path: string, index: number) => void;
|
||||
cleanKey: (path: string, key: string) => void;
|
||||
}) {
|
||||
const [open, setModal] = useState(false);
|
||||
const [smsIndex, setSmsIndex] = useState('');
|
||||
const [labelType, setLabelType] = useState('');
|
||||
|
||||
const { sms, setValue, addItem, removeItem, cleanKey } = props;
|
||||
return (
|
||||
<Col flex="auto">
|
||||
<Divider orientation="left" className={Styles.title}>
|
||||
天翼云云短信配置
|
||||
</Divider>
|
||||
<Tabs
|
||||
tabPosition={'top'}
|
||||
size={'middle'}
|
||||
type="editable-card"
|
||||
// hideAdd={!(sms.length > 0)}
|
||||
onEdit={(targetKey: any, action: 'add' | 'remove') => {
|
||||
if (action === 'add') {
|
||||
addItem('', sms.length);
|
||||
} else {
|
||||
removeItem('', parseInt(targetKey, 10));
|
||||
}
|
||||
}}
|
||||
items={
|
||||
sms.length > 0
|
||||
? sms.map((ele, idx) => ({
|
||||
key: `${idx}`,
|
||||
label: `短信${idx + 1}`,
|
||||
children: (
|
||||
<Form
|
||||
colon={false}
|
||||
labelAlign="left"
|
||||
layout="vertical"
|
||||
style={{ marginTop: 10 }}
|
||||
>
|
||||
<Form.Item
|
||||
label="accessKey"
|
||||
name="accessKey"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入accessKey"
|
||||
type="text"
|
||||
value={ele.accessKey}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.accessKey`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="securityKey"
|
||||
name="securityKey"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入securityKey"
|
||||
type="text"
|
||||
value={ele.securityKey}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.securityKey`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="endpoint"
|
||||
name="endpoint"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入endpoint"
|
||||
type="text"
|
||||
value={ele.endpoint}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.endpoint`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="defaultSignName"
|
||||
name="defaultSignName"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入defaultSignName"
|
||||
type="text"
|
||||
value={ele.defaultSignName}
|
||||
onChange={(e) =>
|
||||
setValue(
|
||||
`${idx}.defaultSignName`,
|
||||
e.target.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
{/* <Form.Item
|
||||
label="templates"
|
||||
name="templates"
|
||||
>
|
||||
<Tabs
|
||||
tabPosition={'top'}
|
||||
size={'middle'}
|
||||
type="editable-card"
|
||||
// hideAdd={!(Object.keys(ele.templates).length > 0)}
|
||||
onEdit={(
|
||||
targetKey: any,
|
||||
action: 'add' | 'remove'
|
||||
) => {
|
||||
if (action === 'add') {
|
||||
setSmsIndex(`${idx}`);
|
||||
setModal(true);
|
||||
} else {
|
||||
cleanKey(
|
||||
`${idx}.templates`,
|
||||
targetKey
|
||||
);
|
||||
}
|
||||
}}
|
||||
items={
|
||||
Object.keys(
|
||||
ele.templates || {}
|
||||
).length > 0
|
||||
? Object.keys(
|
||||
ele.templates
|
||||
).map((name, idx) => {
|
||||
const template =
|
||||
ele.templates[
|
||||
name
|
||||
];
|
||||
return {
|
||||
key: `${name}`,
|
||||
label: `${name}`,
|
||||
children: (
|
||||
<Form
|
||||
colon={
|
||||
true
|
||||
}
|
||||
labelAlign="left"
|
||||
layout="vertical"
|
||||
style={{
|
||||
marginTop: 10,
|
||||
}}
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入code"
|
||||
type="text"
|
||||
value={
|
||||
template.code
|
||||
}
|
||||
onChange={(
|
||||
e
|
||||
) =>
|
||||
setValue(
|
||||
`${idx}.templates.${name}.code`,
|
||||
<Form.Item
|
||||
label="signName"
|
||||
name="signName"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入signName"
|
||||
type="text"
|
||||
value={
|
||||
template.signName
|
||||
}
|
||||
onChange={(
|
||||
e
|
||||
.target
|
||||
.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
),
|
||||
};
|
||||
})
|
||||
: []
|
||||
}
|
||||
></Tabs>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
),
|
||||
}))
|
||||
) =>
|
||||
setValue(
|
||||
`${idx}.templates.${name}.signName`,
|
||||
e
|
||||
.target
|
||||
.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="code"
|
||||
name="code"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入code"
|
||||
type="text"
|
||||
value={
|
||||
template.code
|
||||
}
|
||||
onChange={(
|
||||
e
|
||||
) =>
|
||||
setValue(
|
||||
`${idx}.templates.${name}.code`,
|
||||
e
|
||||
.target
|
||||
.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
),
|
||||
};
|
||||
})
|
||||
: []
|
||||
}
|
||||
></Tabs>
|
||||
</Form.Item> */}
|
||||
</Form>
|
||||
),
|
||||
}))
|
||||
: []
|
||||
}
|
||||
></Tabs>
|
||||
|
|
@ -537,7 +928,7 @@ export default function Sms(props: {
|
|||
cleanKey: (path: string, key: string) => void;
|
||||
}) {
|
||||
const { sms, setValue, removeItem, cleanKey } = props;
|
||||
const { ali, tencent, mockSend } = sms;
|
||||
const { ali, tencent, mockSend, ctyun } = sms;
|
||||
return (
|
||||
<Space direction="vertical" size="middle" style={{ display: 'flex' }}>
|
||||
<Row>
|
||||
|
|
@ -582,6 +973,13 @@ export default function Sms(props: {
|
|||
addItem={(path, index) => setValue(`ali.${index}`, {})}
|
||||
cleanKey={(path, key) => cleanKey(`ali.${path}`, key)}
|
||||
/>
|
||||
<CTYun
|
||||
sms={ctyun || []}
|
||||
setValue={(path, value) => setValue(`ctyun.${path}`, value)}
|
||||
removeItem={(path, index) => removeItem(`ctyun`, index)}
|
||||
addItem={(path, index) => setValue(`ctyun.${index}`, {})}
|
||||
cleanKey={(path, key) => cleanKey(`ctyun.${path}`, key)}
|
||||
/>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
|
|
@ -5,11 +5,6 @@ export type QiniuCloudConfig = {
|
|||
secretKey: string;
|
||||
};
|
||||
|
||||
export type CTYunConfig = {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
}
|
||||
|
||||
export type QiniuLiveConfig = {
|
||||
accessKey: string;
|
||||
liveHost: string; // 七牛直播云接口域名
|
||||
|
|
@ -65,6 +60,12 @@ export type TencentCloudConfig = {
|
|||
smsEndpoint: string;
|
||||
};
|
||||
|
||||
export type CTYunCloudConfig = {
|
||||
accessKey: string;
|
||||
securityKey: string;
|
||||
smsEndpoint: string;
|
||||
};
|
||||
|
||||
export type AmapCloudConfig = {
|
||||
webApiKey: string;
|
||||
}
|
||||
|
|
@ -73,6 +74,14 @@ export type AliSmsConfig = {
|
|||
accessKeyId: string;
|
||||
accessKeySecret: string;
|
||||
defaultSignName: string;
|
||||
apiVersion: string;
|
||||
endpoint: string;
|
||||
};
|
||||
|
||||
export type CTYunSmsConfig = {
|
||||
accessKey: string;
|
||||
securityKey: string;
|
||||
defaultSignName: string;
|
||||
endpoint: string;
|
||||
};
|
||||
|
||||
|
|
@ -117,13 +126,14 @@ export type Config = {
|
|||
mockSend?: boolean;
|
||||
ali?: AliSmsConfig[];
|
||||
tencent?: TencentSmsConfig[];
|
||||
ctyun?: CTYunSmsConfig[];
|
||||
};
|
||||
App: {
|
||||
qrCodeType?: QrCodeType; // 生成二维码时,优先生成的类型
|
||||
qrCodeApplicationId?: string; // 生成二维码时,优先使用的appId
|
||||
qrCodePublicForMpId?: string; // 如果qrCodeType是wechatPublicForMp,在此指明关联的小程序appId
|
||||
mpShareImageUrl?: string; // 小程序分享时的imageUrl(使用网络图片,5:4)
|
||||
mergeUserDirectly?: boolean; // 当发现用户具有相同的特征时直接合并
|
||||
qrCodeType?: QrCodeType; // 生成二维码时,优先生成的类型
|
||||
qrCodeApplicationId?: string; // 生成二维码时,优先使用的appId
|
||||
qrCodePublicForMpId?: string; // 如果qrCodeType是wechatPublicForMp,在此指明关联的小程序appId
|
||||
mpShareImageUrl?: string; // 小程序分享时的imageUrl(使用网络图片,5:4)
|
||||
mergeUserDirectly?: boolean; // 当发现用户具有相同的特征时直接合并
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -38,11 +38,8 @@ export default class Tencent implements Sms<ED, BackendRuntimeContext<ED>> {
|
|||
'Sms.tencent.0',
|
||||
{}
|
||||
) as TencentSmsConfig;
|
||||
const { secretId,
|
||||
secretKey,
|
||||
region,
|
||||
endpoint,
|
||||
smsSdkAppId } = tencentConfig;
|
||||
const { secretId, secretKey, region, endpoint, smsSdkAppId } =
|
||||
tencentConfig;
|
||||
assert(secretId, 'secretId未配置');
|
||||
assert(secretKey, 'secretKey未配置');
|
||||
assert(region, 'region未配置');
|
||||
|
|
|
|||
Loading…
Reference in New Issue