diff --git a/es/checkers/index.d.ts b/es/checkers/index.d.ts index 33ac389ff..4a38c8a8d 100644 --- a/es/checkers/index.d.ts +++ b/es/checkers/index.d.ts @@ -1,2 +1,2 @@ -declare const checkers: (import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker>)[]; +declare const checkers: (import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker>)[]; export default checkers; diff --git a/es/components/article/detail/index.d.ts b/es/components/article/detail/index.d.ts index 581852538..deb2c924c 100644 --- a/es/components/article/detail/index.d.ts +++ b/es/components/article/detail/index.d.ts @@ -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; diff --git a/es/components/article/preview/index.d.ts b/es/components/article/preview/index.d.ts index 00e9a24d8..50aab296a 100644 --- a/es/components/article/preview/index.d.ts +++ b/es/components/article/preview/index.d.ts @@ -1,7 +1,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps void; - tocPosition: "none" | "left" | "right"; + tocPosition: "left" | "right" | "none"; highlightBgColor: string; onArticlePreview: (content?: string, title?: string) => void; origin: string; diff --git a/es/components/articleMenu/treeManager/index.d.ts b/es/components/articleMenu/treeManager/index.d.ts index 5954fb2a1..554c94f9e 100644 --- a/es/components/articleMenu/treeManager/index.d.ts +++ b/es/components/articleMenu/treeManager/index.d.ts @@ -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; diff --git a/es/components/config/style/platform/index.d.ts b/es/components/config/style/platform/index.d.ts index 8835a6c5f..d8601ae9e 100644 --- a/es/components/config/style/platform/index.d.ts +++ b/es/components/config/style/platform/index.d.ts @@ -1,7 +1,7 @@ import { Style } from '../../../../types/Style'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; diff --git a/es/components/config/upsert/index.d.ts b/es/components/config/upsert/index.d.ts index a4b61c5c2..9bf014f88 100644 --- a/es/components/config/upsert/index.d.ts +++ b/es/components/config/upsert/index.d.ts @@ -1,7 +1,7 @@ import { Config } from '../../../types/Config'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; diff --git a/es/components/config/upsert/sms/index.js b/es/components/config/upsert/sms/index.js index 43d70952e..31f6dc0d0 100644 --- a/es/components/config/upsert/sms/index.js +++ b/es/components/config/upsert/sms/index.js @@ -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 ( @@ -50,151 +46,12 @@ function Ali(props) { setValue(`${idx}.defaultSignName`, e.target.value)}/> - {/* - 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: ( -
- - <> - - setValue( - `${idx}.templates.${name}.signName`, - e - .target - .value - ) - } - /> - - - - <> - - setValue( - `${idx}.templates.${name}.code`, - e - .target - .value - ) - } - /> - - -
- ), - }; - }) - : [] - } - >
-
*/} ), })) : []}> - { - 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}> -
- - <> - setLabelType(e.target.value.replace(/[0-9-.]/g, ''))}/> - - -
-
); } function Tencent(props) { - const [open, setModal] = useState(false); - const [smsIndex, setSmsIndex] = useState(''); - const [labelType, setLabelType] = useState(''); const { sms, setValue, addItem, removeItem, cleanKey } = props; return ( @@ -244,86 +101,12 @@ function Tencent(props) { setValue(`${idx}.defaultSignName`, e.target.value)}/> - - 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: (
- - <> - setValue(`${idx}.templates.${name}.signName`, e - .target - .value)}/> - - - - <> - setValue(`${idx}.templates.${name}.code`, e - .target - .value)}/> - - -
), - }; - }) - : []}>
-
), })) : []}> - { - 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}> -
- - <> - setLabelType(e.target.value.replace(/[0-9-.]/g, ''))}/> - - -
-
); } function CTYun(props) { - const [open, setModal] = useState(false); - const [smsIndex, setSmsIndex] = useState(''); - const [labelType, setLabelType] = useState(''); const { sms, setValue, addItem, removeItem, cleanKey } = props; return ( @@ -363,145 +146,9 @@ function CTYun(props) { setValue(`${idx}.defaultSignName`, e.target.value)}/> - {/* - 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: ( -
- - <> - - setValue( - `${idx}.templates.${name}.signName`, - e - .target - .value - ) - } - /> - - - - <> - - setValue( - `${idx}.templates.${name}.code`, - e - .target - .value - ) - } - /> - - -
- ), - }; - }) - : [] - } - >
-
*/} ), })) : []}> - { - 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}> -
- - <> - setLabelType(e.target.value.replace(/[0-9-.]/g, ''))}/> - - -
-
); } export default function Sms(props) { diff --git a/es/components/extraFile/commit/index.d.ts b/es/components/extraFile/commit/index.d.ts index 65add993a..2b5d47f16 100644 --- a/es/components/extraFile/commit/index.d.ts +++ b/es/components/extraFile/commit/index.d.ts @@ -24,7 +24,7 @@ declare const _default: ) => unknown) | undefined; - type?: "reset" | "submit" | "button" | undefined; + type?: "button" | "submit" | "reset" | undefined; shape?: "default" | "rounded" | "rectangular" | undefined; children?: import("react").ReactNode; } & Pick & import("react").ButtonHTMLAttributes, "id" | "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & { diff --git a/es/entities/Application.d.ts b/es/entities/Application.d.ts index 26130b763..4b4440651 100644 --- a/es/entities/Application.d.ts +++ b/es/entities/Application.d.ts @@ -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:'; diff --git a/es/oak-app-domain/Application/Schema.d.ts b/es/oak-app-domain/Application/Schema.d.ts index 55c324c2d..b1ec32731 100644 --- a/es/oak-app-domain/Application/Schema.d.ts +++ b/es/oak-app-domain/Application/Schema.d.ts @@ -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:"; diff --git a/es/triggers/application.js b/es/triggers/application.js index fb0045d08..7c3e815db 100644 --- a/es/triggers/application.js +++ b/es/triggers/application.js @@ -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', diff --git a/es/triggers/index.d.ts b/es/triggers/index.d.ts index 7d32f3341..44c465330 100644 --- a/es/triggers/index.d.ts +++ b/es/triggers/index.d.ts @@ -1,2 +1,2 @@ -declare const _default: (import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger>)[]; +declare const _default: (import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger>)[]; export default _default; diff --git a/es/types/Config.d.ts b/es/types/Config.d.ts index 13bb10c55..55d517cc5 100644 --- a/es/types/Config.d.ts +++ b/es/types/Config.d.ts @@ -122,10 +122,6 @@ export type TencentSmsConfig = { region: string; defaultSignName: string; endpoint: string; - templates: Record; }; export type QrCodeType = 'wechatMpDomainUrl' | 'wechatMpWxaCode' | 'wechatPublic' | 'wechatPublicForMp' | 'webForWechatPublic'; export type Config = { diff --git a/lib/checkers/index.d.ts b/lib/checkers/index.d.ts index 33ac389ff..4a38c8a8d 100644 --- a/lib/checkers/index.d.ts +++ b/lib/checkers/index.d.ts @@ -1,2 +1,2 @@ -declare const checkers: (import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker>)[]; +declare const checkers: (import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker> | import("oak-domain/lib/types").Checker>)[]; export default checkers; diff --git a/lib/entities/Application.d.ts b/lib/entities/Application.d.ts index 26130b763..4b4440651 100644 --- a/lib/entities/Application.d.ts +++ b/lib/entities/Application.d.ts @@ -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:'; diff --git a/lib/oak-app-domain/Application/Schema.d.ts b/lib/oak-app-domain/Application/Schema.d.ts index 55c324c2d..b1ec32731 100644 --- a/lib/oak-app-domain/Application/Schema.d.ts +++ b/lib/oak-app-domain/Application/Schema.d.ts @@ -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:"; diff --git a/lib/triggers/application.js b/lib/triggers/application.js index 0aab32d46..d0b7ed9dc 100644 --- a/lib/triggers/application.js +++ b/lib/triggers/application.js @@ -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', diff --git a/lib/triggers/index.d.ts b/lib/triggers/index.d.ts index 7d32f3341..24f2e1939 100644 --- a/lib/triggers/index.d.ts +++ b/lib/triggers/index.d.ts @@ -1,2 +1,2 @@ -declare const _default: (import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger>)[]; +declare const _default: (import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger>)[]; export default _default; diff --git a/lib/triggers/toDo.d.ts b/lib/triggers/toDo.d.ts index 945523f77..36cbfbff9 100644 --- a/lib/triggers/toDo.d.ts +++ b/lib/triggers/toDo.d.ts @@ -14,7 +14,7 @@ export declare function createToDo; +}, userIds?: string[]): Promise<1 | 0>; /** * 完成todo例程,当在entity对象上进行action操作时(操作条件是filter),将对应的todo完成 * 必须在entity的action的后trigger中调用 diff --git a/lib/types/Config.d.ts b/lib/types/Config.d.ts index 13bb10c55..55d517cc5 100644 --- a/lib/types/Config.d.ts +++ b/lib/types/Config.d.ts @@ -122,10 +122,6 @@ export type TencentSmsConfig = { region: string; defaultSignName: string; endpoint: string; - templates: Record; }; export type QrCodeType = 'wechatMpDomainUrl' | 'wechatMpWxaCode' | 'wechatPublic' | 'wechatPublicForMp' | 'webForWechatPublic'; export type Config = { diff --git a/src/components/config/upsert/sms/index.tsx b/src/components/config/upsert/sms/index.tsx index 0d8fb100d..d583db65d 100644 --- a/src/components/config/upsert/sms/index.tsx +++ b/src/components/config/upsert/sms/index.tsx @@ -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: { /> - {/* - 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: ( -
- - <> - - setValue( - `${idx}.templates.${name}.signName`, - e - .target - .value - ) - } - /> - - - - <> - - setValue( - `${idx}.templates.${name}.code`, - e - .target - .value - ) - } - /> - - -
- ), - }; - }) - : [] - } - >
-
*/} ), })) : [] } > - { - 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} - > -
- - <> - - setLabelType( - e.target.value.replace(/[0-9-.]/g, '') - ) - } - /> - - -
-
); } @@ -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: { /> - - 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: ( -
- - <> - - setValue( - `${idx}.templates.${name}.signName`, - e - .target - .value - ) - } - /> - - - - <> - - setValue( - `${idx}.templates.${name}.code`, - e - .target - .value - ) - } - /> - - -
- ), - }; - }) - : [] - } - >
-
), })) : [] } > - { - 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} - > -
- - <> - - setLabelType( - e.target.value.replace(/[0-9-.]/g, '') - ) - } - /> - - -
-
); } @@ -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: { /> - {/* - 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: ( -
- - <> - - setValue( - `${idx}.templates.${name}.signName`, - e - .target - .value - ) - } - /> - - - - <> - - setValue( - `${idx}.templates.${name}.code`, - e - .target - .value - ) - } - /> - - -
- ), - }; - }) - : [] - } - >
-
*/} ), })) : [] } > - { - 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} - > -
- - <> - - setLabelType( - e.target.value.replace(/[0-9-.]/g, '') - ) - } - /> - - -
-
); } diff --git a/src/entities/Application.ts b/src/entities/Application.ts index 89a905cb8..f5e12be28 100644 --- a/src/entities/Application.ts +++ b/src/entities/Application.ts @@ -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:'; diff --git a/src/triggers/application.ts b/src/triggers/application.ts index e8eda978c..96dacae77 100644 --- a/src/triggers/application.ts +++ b/src/triggers/application.ts @@ -11,71 +11,6 @@ import { WechatMpConfig, WechatPublicConfig } from '../entities/Application'; import { assert } from 'oak-domain/lib/utils/assert'; const triggers: Trigger>[] = [ - { - 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', diff --git a/src/types/Config.ts b/src/types/Config.ts index 9237b8eec..73079befc 100644 --- a/src/types/Config.ts +++ b/src/types/Config.ts @@ -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';