移除短信配置 弃用的声明
This commit is contained in:
parent
5fdd7da781
commit
0007146658
|
|
@ -1,2 +1,2 @@
|
|||
declare const checkers: (import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "applicationPassport", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>>)[];
|
||||
declare const checkers: (import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "applicationPassport", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>>)[];
|
||||
export default checkers;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
|||
tocWidth: number;
|
||||
tocClosed: boolean;
|
||||
tocFixed: boolean;
|
||||
tocPosition: "none" | "left" | "right";
|
||||
tocPosition: "left" | "right" | "none";
|
||||
highlightBgColor: string;
|
||||
headerTop: number;
|
||||
className: string;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, {
|
||||
tocClosed: boolean;
|
||||
tocFixed: boolean;
|
||||
tocPosition: "none" | "left" | "right";
|
||||
tocPosition: "left" | "right" | "none";
|
||||
highlightBgColor: string;
|
||||
headerTop: number;
|
||||
className: string;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { EntityDict } from '../../../oak-app-domain';
|
|||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "article", false, {
|
||||
articleMenuId: string;
|
||||
changeIsEdit: () => void;
|
||||
tocPosition: "none" | "left" | "right";
|
||||
tocPosition: "left" | "right" | "none";
|
||||
highlightBgColor: string;
|
||||
onArticlePreview: (content?: string, title?: string) => void;
|
||||
origin: string;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
|||
show: "edit" | "doc" | "preview";
|
||||
articleMenuId: string;
|
||||
articleId: string;
|
||||
tocPosition: "none" | "left" | "right";
|
||||
tocPosition: "left" | "right" | "none";
|
||||
highlightBgColor: string;
|
||||
onMenuView: () => void;
|
||||
onMenuViewById: (articleMenuId: string) => void;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Style } from '../../../../types/Style';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../../oak-app-domain").EntityDict, keyof import("../../../../oak-app-domain").EntityDict, false, {
|
||||
style: Style;
|
||||
entity: "application" | "system" | "platform";
|
||||
entity: "application" | "platform" | "system";
|
||||
entityId: string;
|
||||
name: string;
|
||||
}>) => React.ReactElement;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Config } from '../../../types/Config';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, {
|
||||
config: Config;
|
||||
entity: "system" | "platform";
|
||||
entity: "platform" | "system";
|
||||
name: string;
|
||||
entityId: string;
|
||||
}>) => React.ReactElement;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
import React, { useState } from 'react';
|
||||
import { Tabs, Row, Col, Card, Divider, Input, Form, Space, Select, Modal, message, Switch, } from 'antd';
|
||||
import { get } from 'oak-domain/lib/utils/lodash';
|
||||
import React from 'react';
|
||||
import { Tabs, Row, Col, Card, Divider, Input, Form, Space, Select, Switch, } from 'antd';
|
||||
import Styles from './web.module.less';
|
||||
function Ali(props) {
|
||||
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}>
|
||||
|
|
@ -50,151 +46,12 @@ function Ali(props) {
|
|||
<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"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入signName"
|
||||
type="text"
|
||||
value={
|
||||
template.signName
|
||||
}
|
||||
onChange={(
|
||||
e
|
||||
) =>
|
||||
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 Tencent(props) {
|
||||
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}>
|
||||
|
|
@ -244,86 +101,12 @@ function Tencent(props) {
|
|||
<Input placeholder="请输入defaultSignName" type="text" value={ele.defaultSignName} onChange={(e) => setValue(`${idx}.defaultSignName`, e.target.value)}/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item label="templates">
|
||||
<Tabs tabPosition={'top'} size={'middle'} type="editable-card"
|
||||
// hideAdd={!(Object.keys(ele.templates).length > 0)}
|
||||
onEdit={(targetKey, action) => {
|
||||
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">
|
||||
<>
|
||||
<Input placeholder="请输入signName" type="text" value={template.signName} onChange={(e) => setValue(`${idx}.templates.${name}.signName`, e
|
||||
.target
|
||||
.value)}/>
|
||||
</>
|
||||
</Form.Item>
|
||||
<Form.Item label="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) {
|
||||
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}>
|
||||
|
|
@ -363,145 +146,9 @@ function CTYun(props) {
|
|||
<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"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入signName"
|
||||
type="text"
|
||||
value={
|
||||
template.signName
|
||||
}
|
||||
onChange={(
|
||||
e
|
||||
) =>
|
||||
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>);
|
||||
}
|
||||
export default function Sms(props) {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
|
|||
loadingIcon?: import("react").ReactNode;
|
||||
disabled?: boolean | undefined;
|
||||
onClick?: ((event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => unknown) | undefined;
|
||||
type?: "reset" | "submit" | "button" | undefined;
|
||||
type?: "button" | "submit" | "reset" | undefined;
|
||||
shape?: "default" | "rounded" | "rectangular" | undefined;
|
||||
children?: import("react").ReactNode;
|
||||
} & Pick<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "id" | "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ export type WechatPublicConfig = {
|
|||
appId: string;
|
||||
appSecret: string;
|
||||
originalId?: string;
|
||||
enable?: boolean;
|
||||
templateMsgs?: WechatPublicTemplateMsgsConfig;
|
||||
server?: {
|
||||
url?: string;
|
||||
|
|
@ -69,7 +68,6 @@ export type NativeConfig = {
|
|||
appId: string;
|
||||
appSecret: string;
|
||||
domain?: string;
|
||||
enable?: boolean;
|
||||
};
|
||||
location: {
|
||||
protocol: 'http:' | 'https:';
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ export type WechatPublicConfig = {
|
|||
appId: string;
|
||||
appSecret: string;
|
||||
originalId?: string;
|
||||
enable?: boolean;
|
||||
templateMsgs?: WechatPublicTemplateMsgsConfig;
|
||||
server?: {
|
||||
url?: string;
|
||||
|
|
@ -84,7 +83,6 @@ export type NativeConfig = {
|
|||
appId: string;
|
||||
appSecret: string;
|
||||
domain?: string;
|
||||
enable?: boolean;
|
||||
};
|
||||
location: {
|
||||
protocol: "http:" | "https:";
|
||||
|
|
|
|||
|
|
@ -1,72 +1,7 @@
|
|||
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import { set, union } from 'oak-domain/lib/utils/lodash';
|
||||
import { union } from 'oak-domain/lib/utils/lodash';
|
||||
import { assert } from 'oak-domain/lib/utils/assert';
|
||||
const triggers = [
|
||||
{
|
||||
name: '切换微信扫码登录方式',
|
||||
entity: 'application',
|
||||
action: 'update',
|
||||
when: 'after',
|
||||
fn: async ({ operation }, context) => {
|
||||
const { data, filter } = operation;
|
||||
const [application] = await context.select('application', {
|
||||
data: {
|
||||
id: 1,
|
||||
config: 1,
|
||||
},
|
||||
filter: {
|
||||
id: filter?.id,
|
||||
},
|
||||
count: 1,
|
||||
}, {});
|
||||
const { config } = application || {};
|
||||
const toggleEnabelFn = async (type) => {
|
||||
const [applicationP] = await context.select('application', {
|
||||
data: {
|
||||
id: 1,
|
||||
config: 1,
|
||||
},
|
||||
filter: {
|
||||
type,
|
||||
},
|
||||
count: 1,
|
||||
}, {});
|
||||
const { config: config2, id } = applicationP || {};
|
||||
if (config2 && config2.type === type) {
|
||||
if (type === 'web') {
|
||||
set(config2, 'wechat.enable', false);
|
||||
}
|
||||
if (type === 'wechatPublic') {
|
||||
Object.assign(config2, {
|
||||
enable: false
|
||||
});
|
||||
}
|
||||
await context.operate('application', {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'update',
|
||||
data: {
|
||||
config: config2,
|
||||
},
|
||||
filter: {
|
||||
id,
|
||||
}
|
||||
}, {});
|
||||
}
|
||||
};
|
||||
if (config?.type === 'web') {
|
||||
const { wechat } = config;
|
||||
if (wechat && wechat.enable) {
|
||||
await toggleEnabelFn('wechatPublic');
|
||||
}
|
||||
}
|
||||
else if (config?.type === 'wechatPublic') {
|
||||
if (config.enable) {
|
||||
await toggleEnabelFn('web');
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '删除application前,将关联的applicationPassport删除',
|
||||
entity: 'application',
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
||||
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -122,10 +122,6 @@ export type TencentSmsConfig = {
|
|||
region: string;
|
||||
defaultSignName: string;
|
||||
endpoint: string;
|
||||
templates: Record<string, {
|
||||
signName?: string;
|
||||
code: string;
|
||||
}>;
|
||||
};
|
||||
export type QrCodeType = 'wechatMpDomainUrl' | 'wechatMpWxaCode' | 'wechatPublic' | 'wechatPublicForMp' | 'webForWechatPublic';
|
||||
export type Config = {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
declare const checkers: (import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "applicationPassport", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>>)[];
|
||||
declare const checkers: (import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "applicationPassport", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>>)[];
|
||||
export default checkers;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ export type WechatPublicConfig = {
|
|||
appId: string;
|
||||
appSecret: string;
|
||||
originalId?: string;
|
||||
enable?: boolean;
|
||||
templateMsgs?: WechatPublicTemplateMsgsConfig;
|
||||
server?: {
|
||||
url?: string;
|
||||
|
|
@ -69,7 +68,6 @@ export type NativeConfig = {
|
|||
appId: string;
|
||||
appSecret: string;
|
||||
domain?: string;
|
||||
enable?: boolean;
|
||||
};
|
||||
location: {
|
||||
protocol: 'http:' | 'https:';
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ export type WechatPublicConfig = {
|
|||
appId: string;
|
||||
appSecret: string;
|
||||
originalId?: string;
|
||||
enable?: boolean;
|
||||
templateMsgs?: WechatPublicTemplateMsgsConfig;
|
||||
server?: {
|
||||
url?: string;
|
||||
|
|
@ -84,7 +83,6 @@ export type NativeConfig = {
|
|||
appId: string;
|
||||
appSecret: string;
|
||||
domain?: string;
|
||||
enable?: boolean;
|
||||
};
|
||||
location: {
|
||||
protocol: "http:" | "https:";
|
||||
|
|
|
|||
|
|
@ -4,71 +4,6 @@ const uuid_1 = require("oak-domain/lib/utils/uuid");
|
|||
const lodash_1 = require("oak-domain/lib/utils/lodash");
|
||||
const assert_1 = require("oak-domain/lib/utils/assert");
|
||||
const triggers = [
|
||||
{
|
||||
name: '切换微信扫码登录方式',
|
||||
entity: 'application',
|
||||
action: 'update',
|
||||
when: 'after',
|
||||
fn: async ({ operation }, context) => {
|
||||
const { data, filter } = operation;
|
||||
const [application] = await context.select('application', {
|
||||
data: {
|
||||
id: 1,
|
||||
config: 1,
|
||||
},
|
||||
filter: {
|
||||
id: filter?.id,
|
||||
},
|
||||
count: 1,
|
||||
}, {});
|
||||
const { config } = application || {};
|
||||
const toggleEnabelFn = async (type) => {
|
||||
const [applicationP] = await context.select('application', {
|
||||
data: {
|
||||
id: 1,
|
||||
config: 1,
|
||||
},
|
||||
filter: {
|
||||
type,
|
||||
},
|
||||
count: 1,
|
||||
}, {});
|
||||
const { config: config2, id } = applicationP || {};
|
||||
if (config2 && config2.type === type) {
|
||||
if (type === 'web') {
|
||||
(0, lodash_1.set)(config2, 'wechat.enable', false);
|
||||
}
|
||||
if (type === 'wechatPublic') {
|
||||
Object.assign(config2, {
|
||||
enable: false
|
||||
});
|
||||
}
|
||||
await context.operate('application', {
|
||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||
action: 'update',
|
||||
data: {
|
||||
config: config2,
|
||||
},
|
||||
filter: {
|
||||
id,
|
||||
}
|
||||
}, {});
|
||||
}
|
||||
};
|
||||
if (config?.type === 'web') {
|
||||
const { wechat } = config;
|
||||
if (wechat && wechat.enable) {
|
||||
await toggleEnabelFn('wechatPublic');
|
||||
}
|
||||
}
|
||||
else if (config?.type === 'wechatPublic') {
|
||||
if (config.enable) {
|
||||
await toggleEnabelFn('web');
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '删除application前,将关联的applicationPassport删除',
|
||||
entity: 'application',
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
||||
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export declare function createToDo<ED extends EntityDict & BaseEntityDict, T ext
|
|||
redirectTo: EntityDict['toDo']['OpSchema']['redirectTo'];
|
||||
entity: any;
|
||||
entityId: string;
|
||||
}, userIds?: string[]): Promise<0 | 1>;
|
||||
}, userIds?: string[]): Promise<1 | 0>;
|
||||
/**
|
||||
* 完成todo例程,当在entity对象上进行action操作时(操作条件是filter),将对应的todo完成
|
||||
* 必须在entity的action的后trigger中调用
|
||||
|
|
|
|||
|
|
@ -122,10 +122,6 @@ export type TencentSmsConfig = {
|
|||
region: string;
|
||||
defaultSignName: string;
|
||||
endpoint: string;
|
||||
templates: Record<string, {
|
||||
signName?: string;
|
||||
code: string;
|
||||
}>;
|
||||
};
|
||||
export type QrCodeType = 'wechatMpDomainUrl' | 'wechatMpWxaCode' | 'wechatPublic' | 'wechatPublicForMp' | 'webForWechatPublic';
|
||||
export type Config = {
|
||||
|
|
|
|||
|
|
@ -25,9 +25,6 @@ function Ali(props: {
|
|||
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 (
|
||||
|
|
@ -149,172 +146,12 @@ function Ali(props: {
|
|||
/>
|
||||
</>
|
||||
</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"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入signName"
|
||||
type="text"
|
||||
value={
|
||||
template.signName
|
||||
}
|
||||
onChange={(
|
||||
e
|
||||
) =>
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
|
@ -326,9 +163,6 @@ function Tencent(props: {
|
|||
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 (
|
||||
|
|
@ -468,172 +302,12 @@ function Tencent(props: {
|
|||
/>
|
||||
</>
|
||||
</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"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入signName"
|
||||
type="text"
|
||||
value={
|
||||
template.signName
|
||||
}
|
||||
onChange={(
|
||||
e
|
||||
) =>
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
|
@ -645,9 +319,6 @@ function CTYun(props: {
|
|||
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 (
|
||||
|
|
@ -751,172 +422,12 @@ function CTYun(props: {
|
|||
/>
|
||||
</>
|
||||
</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"
|
||||
>
|
||||
<>
|
||||
<Input
|
||||
placeholder="请输入signName"
|
||||
type="text"
|
||||
value={
|
||||
template.signName
|
||||
}
|
||||
onChange={(
|
||||
e
|
||||
) =>
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ export type WechatPublicConfig = {
|
|||
appId: string;
|
||||
appSecret: string;
|
||||
originalId?: string; //原始id
|
||||
enable?: boolean;
|
||||
templateMsgs?: WechatPublicTemplateMsgsConfig;
|
||||
server?: {
|
||||
url?: string; //服务器地址(URL)
|
||||
|
|
@ -77,7 +76,6 @@ export type NativeConfig = {
|
|||
appId: string;
|
||||
appSecret: string; //微信App授权登录
|
||||
domain?: string;
|
||||
enable?: boolean; //启用
|
||||
};
|
||||
location: {
|
||||
protocol: 'http:' | 'https:';
|
||||
|
|
|
|||
|
|
@ -11,71 +11,6 @@ import { WechatMpConfig, WechatPublicConfig } from '../entities/Application';
|
|||
import { assert } from 'oak-domain/lib/utils/assert';
|
||||
|
||||
const triggers: Trigger<EntityDict, 'application', BRC<EntityDict>>[] = [
|
||||
{
|
||||
name: '切换微信扫码登录方式',
|
||||
entity: 'application',
|
||||
action: 'update',
|
||||
when: 'after',
|
||||
fn: async ({ operation }, context) => {
|
||||
const { data, filter } = operation;
|
||||
const [application] = await context.select('application', {
|
||||
data: {
|
||||
id: 1,
|
||||
config: 1,
|
||||
},
|
||||
filter: {
|
||||
id: filter?.id,
|
||||
},
|
||||
count: 1,
|
||||
}, {})
|
||||
const { config } = application || {};
|
||||
const toggleEnabelFn = async (type: AppType) => {
|
||||
const [applicationP] = await context.select('application', {
|
||||
data: {
|
||||
id: 1,
|
||||
config: 1,
|
||||
},
|
||||
filter: {
|
||||
type,
|
||||
},
|
||||
count: 1,
|
||||
}, {})
|
||||
const { config: config2, id } = applicationP || {};
|
||||
if (config2 && config2.type === type) {
|
||||
if (type === 'web') {
|
||||
set(config2, 'wechat.enable', false);
|
||||
}
|
||||
if (type === 'wechatPublic') {
|
||||
Object.assign(config2, {
|
||||
enable: false
|
||||
})
|
||||
}
|
||||
await context.operate('application', {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'update',
|
||||
data: {
|
||||
config: config2,
|
||||
},
|
||||
filter: {
|
||||
id,
|
||||
}
|
||||
}, {})
|
||||
}
|
||||
}
|
||||
if (config?.type === 'web') {
|
||||
const { wechat } = config;
|
||||
if (wechat && wechat.enable) {
|
||||
await toggleEnabelFn('wechatPublic')
|
||||
}
|
||||
}
|
||||
else if (config?.type === 'wechatPublic') {
|
||||
if (config.enable) {
|
||||
await toggleEnabelFn('web')
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '删除application前,将关联的applicationPassport删除',
|
||||
entity: 'application',
|
||||
|
|
|
|||
|
|
@ -141,13 +141,6 @@ export type TencentSmsConfig = {
|
|||
region: string;
|
||||
defaultSignName: string;
|
||||
endpoint: string;
|
||||
templates: Record<
|
||||
string,
|
||||
{
|
||||
signName?: string;
|
||||
code: string;
|
||||
}
|
||||
>;
|
||||
};
|
||||
|
||||
export type QrCodeType = 'wechatMpDomainUrl' | 'wechatMpWxaCode' | 'wechatPublic' | 'wechatPublicForMp' | 'webForWechatPublic';
|
||||
|
|
|
|||
Loading…
Reference in New Issue