diff --git a/es/aspects/application.d.ts b/es/aspects/application.d.ts index 12733740b..7fdfd2d52 100644 --- a/es/aspects/application.d.ts +++ b/es/aspects/application.d.ts @@ -7,7 +7,7 @@ import { File } from 'formidable'; export declare function getApplication>(params: { type: AppType; domain: string; -}, context: Cxt): Promise; +}, context: Cxt): Promise; export declare function signatureJsSDK>({ url, env }: { url: string; env: WebEnv; diff --git a/es/aspects/application.js b/es/aspects/application.js index 2dd1ebaa8..f3a524845 100644 --- a/es/aspects/application.js +++ b/es/aspects/application.js @@ -8,7 +8,64 @@ export async function getApplication(params, context) { const { type, domain } = params; const url = context.getHeader('host'); console.log('url is', url); - const [application] = await context.select('application', { + + // const [application] = await context.select( + // 'application', + // { + // data: cloneDeep(applicationProjection), + // filter: { + // type, + // system: { + // domain$system: { + // url: domain, + // }, + // }, + // }, + // }, + // {} + // ); + // //微信小程序环境下 没有就报错 + // if (type === 'wechatMp') { + // assert( + // application, + // '微信小程序环境下 application必须存在小程序相关配置' + // ); + // } else if (type === 'native') { + // assert(application, 'APP环境下 application必须存在APP相关配置'); + // } else { + // //web 或 wechatPublic + // if (type === 'wechatPublic') { + // // 如果微信公众号环境下 application不存在公众号配置,但又在公众号访问,这时可以使用web的application + // if (!application) { + // const [application2] = await context.select( + // 'application', + // { + // data: cloneDeep(applicationProjection), + // filter: { + // type: 'web', + // system: { + // domain$system: { + // url: domain, + // }, + // }, + // }, + // }, + // {} + // ); + // assert( + // application2, + // '微信公众号环境下 application不存在公众号配置,但必须存在web相关配置' + // ); + // return application2.id as string; + // } + // } else { + // assert(application, 'web环境下 application必须存在web相关配置'); + // } + // } + // return application.id as string; + // 先找指定domain的应用,如果不存在再找系统下面的domain, 但无论怎么样都必须一项 + // + let applications = await context.select('application', { data: cloneDeep(applicationProjection), filter: { type, @@ -17,21 +74,47 @@ export async function getApplication(params, context) { url: domain, }, }, + domain: { + url: domain, + }, }, }, {}); - //微信小程序环境下 没有就报错 - if (type === 'wechatMp') { - assert(application, '微信小程序环境下 application必须存在小程序相关配置'); + assert(applications.length <= 1, `指定域名的应用 只能存在一项或未指定`); + if (applications.length === 0) { + applications = await context.select( + 'application', + { + data: cloneDeep(applicationProjection), + filter: { + type, + system: { + domain$system: { + url: domain, + }, + }, + domainId: { + $exists: false, + }, + }, + }, + {} + ); } - else if (type === 'native') { - assert(application, 'APP环境下 application必须存在APP相关配置'); - } - else { - //web 或 wechatPublic - if (type === 'wechatPublic') { - // 如果微信公众号环境下 application不存在公众号配置,但又在公众号访问,这时可以使用web的application - if (!application) { - const [application2] = await context.select('application', { + switch (type) { + case 'wechatMp': { + assert(applications.length === 1, `微信小程序环境下,同一个系统必须存在唯一的【${type}】应用`); + const application = applications[0]; + return application.id; + } + case 'native': { + assert(applications.length === 1, `APP环境下,同一个系统必须存在唯一的【${type}】应用`); + const application = applications[0]; + return application.id; + } + case 'wechatPublic': { + // 微信公众号环境下,未配置公众号,可以使用web的application + if (applications.length === 0) { + let applications2 = await context.select('application', { data: cloneDeep(applicationProjection), filter: { type: 'web', @@ -40,17 +123,50 @@ export async function getApplication(params, context) { url: domain, }, }, + domain: { + url: domain, + }, }, }, {}); - assert(application2, '微信公众号环境下 application不存在公众号配置,但必须存在web相关配置'); - return application2.id; + assert(applications2.length <= 1, `指定域名的应用 只能存在一项或未指定`); + if (applications2.length === 0) { + applications2 = await context.select( + 'application', + { + data: cloneDeep(applicationProjection), + filter: { + type, + system: { + domain$system: { + url: domain, + }, + }, + domainId: { + $exists: false, + }, + }, + }, + {} + ); + } + assert(applications2.length === 1, '微信公众号环境下, 可以未配置公众号,但必须存在web的application'); + const application = applications2[0]; + return application.id; } + assert(applications.length === 1, `微信公众号环境下,同一个系统必须存在唯一的【${type}】应用 或 多个${type}应用必须配置域名`); + const application = applications[0]; + return application.id; } - else { - assert(application, 'web环境下 application必须存在web相关配置'); + case 'web': { + assert(applications.length === 1, `web环境下,同一个系统必须存在唯一的【${type}】应用 或 多个${type}应用必须配置域名`); + const application = applications[0]; + return application.id; + } + default: { + assert(false, `不支持的类型【${type}】`); + return; } } - return application.id; } export async function signatureJsSDK({ url, env }, context) { const application = context.getApplication(); @@ -64,7 +180,7 @@ export async function signatureJsSDK({ url, env }, context) { } export async function uploadWechatMedia(params, // FormData表单提交 isPermanent 变成 'true' | 'false' context) { - const { applicationId, file, type: mediaType, description, extraFileId } = params; + const { applicationId, file, type: mediaType, description, extraFileId, } = params; assert(applicationId); const isPermanent = params.isPermanent === 'true'; const filename = file.originalFilename; @@ -98,14 +214,14 @@ context) { if (isPermanent) { // 只有公众号才能上传永久素材 assert(type === 'wechatPublic'); - const result = await wechatInstance.createMaterial({ + const result = (await wechatInstance.createMaterial({ type: mediaType, media: fileStream, filename, filetype, fileLength, description: description ? JSON.parse(description) : null, - }); + })); mediaId = result.media_id; } else { diff --git a/es/aspects/token.js b/es/aspects/token.js index 339cfde1d..36ad8e877 100644 --- a/es/aspects/token.js +++ b/es/aspects/token.js @@ -1062,135 +1062,118 @@ export async function sendCaptcha({ mobile, env, type: type2, }, context) { const closeRootMode = context.openRootMode(); if (process.env.NODE_ENV !== 'development' && !mockSend) { const [count1, count2] = await Promise.all([ - context.count( - 'captcha', - { - filter: { - visitorId, - $$createAt$$: { - $gt: now - 3600 * 1000, - }, - type: type2, + context.count('captcha', { + filter: { + visitorId, + $$createAt$$: { + $gt: now - 3600 * 1000, }, + type: type2, }, - { - dontCollect: true, - } - ), - context.count( - 'captcha', - { - filter: { - mobile, - $$createAt$$: { - $gt: now - 3600 * 1000, - }, - type: type2, + }, { + dontCollect: true, + }), + context.count('captcha', { + filter: { + mobile, + $$createAt$$: { + $gt: now - 3600 * 1000, }, + type: type2, }, - { - dontCollect: true, - } - ), + }, { + dontCollect: true, + }), ]); if (count1 > 5 || count2 > 5) { closeRootMode(); throw new OakUserException('您已发送很多次短信,请休息会再发吧'); } } - const [captcha] = await context.select( - 'captcha', - { - data: { - id: 1, - code: 1, - $$createAt$$: 1, - }, - filter: { - mobile, - $$createAt$$: { - $gt: now - duration * 60 * 1000, - }, - expired: false, - type: type2, - }, + const [captcha] = await context.select('captcha', { + data: { + id: 1, + code: 1, + $$createAt$$: 1, }, - { - dontCollect: true, - } - ); + filter: { + mobile, + $$createAt$$: { + $gt: now - duration * 60 * 1000, + }, + expired: false, + type: type2, + }, + }, { + dontCollect: true, + }); if (captcha) { const code = captcha.code; if (process.env.NODE_ENV === 'development' || mockSend) { closeRootMode(); return `验证码[${code}]已创建`; - } else if (captcha.$$createAt$$ - now < 60000) { + } + else if (captcha.$$createAt$$ - now < 60000) { closeRootMode(); throw new OakUserException('您的操作太迅捷啦,请稍等再点吧'); - } else { + } + else { assert(origin, '必须设置短信渠道'); // todo 再次发送 - const result = await sendSms( - { - origin: origin, - templateName: codeTemplateName, - mobile, - templateParam: { code, duration: duration.toString() }, - }, - context - ); + const result = await sendSms({ + origin: origin, + templateName: codeTemplateName, + mobile, + templateParam: { code, duration: duration.toString() }, + }, context); closeRootMode(); if (result.success) { return '验证码已发送'; } return '验证码发送失败'; } - } else { + } + else { let code; if (process.env.NODE_ENV === 'development' || mockSend) { code = mobile.substring(7); - } else { + } + else { code = Math.floor(Math.random() * 10000).toString(); while (code.length < 4) { code += '0'; } } const id = await generateNewIdAsync(); - await context.operate( - 'captcha', - { - id: await generateNewIdAsync(), - action: 'create', - data: { - id, - mobile, - code, - visitorId, - env, - expired: false, - expiresAt: now + duration * 60 * 1000, - type: type2, - }, + await context.operate('captcha', { + id: await generateNewIdAsync(), + action: 'create', + data: { + id, + mobile, + code, + visitorId, + env, + expired: false, + expiresAt: now + duration * 60 * 1000, + type: type2, }, - { - dontCollect: true, - } - ); + }, { + dontCollect: true, + }); if (process.env.NODE_ENV === 'development' || mockSend) { closeRootMode(); return `验证码[${code}]已创建`; - } else { + } + else { assert(origin, '必须设置短信渠道'); //发送短信 - const result = await sendSms( - { - origin: origin, - templateName: codeTemplateName, - mobile, - templateParam: { code, duration: duration.toString() }, - }, - context - ); + const result = await sendSms({ + origin: origin, + templateName: codeTemplateName, + mobile, + templateParam: { code, duration: duration.toString() }, + }, context); closeRootMode(); if (result.success) { return '验证码已发送'; diff --git a/es/components/application/detail/web.js b/es/components/application/detail/web.js index d23b591b9..58595a6c1 100644 --- a/es/components/application/detail/web.js +++ b/es/components/application/detail/web.js @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Row, Descriptions, Typography, Button, Modal } from 'antd'; +import { Row, Descriptions, Typography, Button, Modal, Space } from 'antd'; import ApplicationUpsert from '../upsert'; export default function Render(props) { const { id, name, description, type, oakFullpath, oakExecutable, oakExecuting } = props.data; @@ -7,15 +7,23 @@ export default function Render(props) { const [open, setOpen] = useState(false); if (id && oakFullpath) { return (<> - { + { clean(); setOpen(false); - }} footer={ + }> + {t('common::action.confirm')} + + }> diff --git a/es/components/application/panel/index.js b/es/components/application/panel/index.js index e0cfb51bf..f32376127 100644 --- a/es/components/application/panel/index.js +++ b/es/components/application/panel/index.js @@ -7,6 +7,8 @@ export default OakComponent({ config: 1, description: 1, type: 1, + systemId: 1, + domainId: 1, }, formData({ data }) { return data || {}; diff --git a/es/components/application/upsert/index.d.ts b/es/components/application/upsert/index.d.ts index f42d9485e..b5c61a374 100644 --- a/es/components/application/upsert/index.d.ts +++ b/es/components/application/upsert/index.d.ts @@ -1,4 +1,5 @@ /// /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; +import { EntityDict } from '../../../oak-app-domain'; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/application/upsert/index.js b/es/components/application/upsert/index.js index aa0eaaa5b..aaee87cd2 100644 --- a/es/components/application/upsert/index.js +++ b/es/components/application/upsert/index.js @@ -1,6 +1,15 @@ export default OakComponent({ isList: false, entity: 'application', + projection: { + id: 1, + name: 1, + config: 1, + description: 1, + type: 1, + systemId: 1, + domainId: 1, + }, formData({ data }) { return data || {}; }, @@ -16,18 +25,29 @@ export default OakComponent({ value: 'wechatPublic', }, ], + domains: [], }, - /* lifetimes: { - ready() { - const { systemId, oakId } = this.props; - - if (!oakId) { - if (systemId) { - this.update({ + methods: { + async getDomains(systemId) { + const { data: domains } = await this.features.cache.refresh( + 'domain', + { + data: { + id: 1, + systemId: 1, + url: 1, + apiPath: 1, + port: 1, + protocol: 1, + }, + filter: { systemId, - }); + }, } - } + ); + this.setState({ + domains, + }); }, - }, */ + }, }); diff --git a/es/components/application/upsert/web.pc.d.ts b/es/components/application/upsert/web.pc.d.ts index db124d3e3..913486145 100644 --- a/es/components/application/upsert/web.pc.d.ts +++ b/es/components/application/upsert/web.pc.d.ts @@ -4,8 +4,6 @@ import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps void; + getDomains: (systemId: string) => Promise; }>): React.JSX.Element; diff --git a/es/components/application/upsert/web.pc.js b/es/components/application/upsert/web.pc.js index 69263917f..cba31e38e 100644 --- a/es/components/application/upsert/web.pc.js +++ b/es/components/application/upsert/web.pc.js @@ -1,8 +1,8 @@ import React from 'react'; import { Form, Select, Input } from 'antd'; export default function Render(props) { - const { name, description, type, typeArr, $$createAt$$, } = props.data; - const { t, update, navigateBack, confirm } = props.methods; + const { systemId, name, description, type, typeArr, $$createAt$$, domainId, domains, } = props.data; + const { t, update, confirm, getDomains } = props.methods; return (
<> @@ -31,6 +31,26 @@ export default function Render(props) { update({ type: value, }); + }}/> + + + + <> + setValue(`mpShareImageUrl`, e.target.value)}/> + + + <> + setValue(`mergeUserDirectly`, checked)}/> + + + + { + const val = e.target.value; + if (val) { + setValue(`tokenRefreshTime`, Number(val)); + } + else { + setValue(`tokenRefreshTime`, val); + } + }} suffix="毫秒"/> + + + { + const val = e.target.value; + if (val) { + setValue(`tokenExpireTime`, Number(val)); + } + else { + setValue(`tokenExpireTime`, val); + } + }} suffix="毫秒"/> + +
+ + ); +} diff --git a/es/components/config/upsert/basic/web.module.less b/es/components/config/upsert/basic/web.module.less new file mode 100644 index 000000000..7fa576eed --- /dev/null +++ b/es/components/config/upsert/basic/web.module.less @@ -0,0 +1,16 @@ + +.label { + color: var(--oak-text-color-primary); + font-size: 28px; + line-height: 36px; +} + +.tips { + color: var(--oak-text-color-placeholder); + font-size: 12px; +} + +.title { + margin-bottom: 0px; + margin-top:36px; +} \ No newline at end of file diff --git a/es/components/config/upsert/sms/index.js b/es/components/config/upsert/sms/index.js index af433059b..09e967be0 100644 --- a/es/components/config/upsert/sms/index.js +++ b/es/components/config/upsert/sms/index.js @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Tabs, Row, Col, Card, Divider, Input, Form, Space, Modal, message, Switch, Select } from 'antd'; +import { Tabs, Row, Col, Card, Divider, Input, Form, Space, Select, Modal, message, Switch, } from 'antd'; import { get } from 'oak-domain/lib/utils/lodash'; import Styles from './web.module.less'; function Ali(props) { @@ -25,27 +25,27 @@ function Ali(props) { key: `${idx}`, label: `短信${idx + 1}`, children: (
- + <> setValue(`${idx}.accessKeyId`, e.target.value)}/> - + <> setValue(`${idx}.accessKeySecret`, e.target.value)}/> - + <> setValue(`${idx}.endpoint`, e.target.value)}/> - + <> setValue(`${idx}.defaultSignName`, e.target.value)}/> - + <> setValue(`${idx}.defaultSignName`, e.target.value)}/> @@ -343,22 +343,22 @@ function CTYun(props) { key: `${idx}`, label: `短信${idx + 1}`, children: ( - + <> setValue(`${idx}.accessKey`, e.target.value)}/> - + <> setValue(`${idx}.securityKey`, e.target.value)}/> - + <> setValue(`${idx}.endpoint`, e.target.value)}/> - + <> setValue(`${idx}.defaultSignName`, e.target.value)}/> @@ -506,9 +506,8 @@ function CTYun(props) { } export default function Sms(props) { const { sms, setValue, removeItem, cleanKey } = props; - const { ali, tencent, mockSend, ctyun } = sms; - return ( - + const { ali, tencent, ctyun } = sms; + return ( 每种均可配置一个,相应的服务所使用的帐号请准确对应 @@ -518,97 +517,43 @@ export default function Sms(props) { 短信配置 - - + + <> - - setValue(`mockSend`, checked) - } - /> + setValue(`mockSend`, checked)}/> - + <> - { + setValue(`defaultOrigin`, value); + }} options={[ + { value: 'ali', label: '阿里云' }, + { value: 'tencent', label: '腾讯云' }, + { value: 'ctyun', label: '天翼云' }, + ]}/> - - - setValue( - `defaultCodeTemplateName`, - e.target.value - ) - } - /> + + setValue(`defaultCodeTemplateName`, e.target.value)}/> - - { - const val = e.target.value; - if (val) { - setValue( - `defaultCodeDuration`, - Number(val) - ); - } else { - setValue(`defaultCodeDuration`, val); - } - }} - suffix="分钟" - /> + + { + const val = e.target.value; + if (val) { + setValue(`defaultCodeDuration`, Number(val)); + } + else { + setValue(`defaultCodeDuration`, val); + } + }} suffix="分钟"/> - setValue(`tencent.${path}`, value)} - removeItem={(path, index) => removeItem(`tencent`, index)} - addItem={(path, index) => setValue(`tencent.${index}`, {})} - cleanKey={(path, key) => cleanKey(`tencent.${path}`, key)} - /> - setValue(`ali.${path}`, value)} - removeItem={(path, index) => removeItem(`ali`, index)} - addItem={(path, index) => setValue(`ali.${index}`, {})} - cleanKey={(path, key) => cleanKey(`ali.${path}`, key)} - /> - setValue(`ctyun.${path}`, value)} - removeItem={(path, index) => removeItem(`ctyun`, index)} - addItem={(path, index) => setValue(`ctyun.${index}`, {})} - cleanKey={(path, key) => cleanKey(`ctyun.${path}`, key)} - /> - - ); + setValue(`tencent.${path}`, value)} removeItem={(path, index) => removeItem(`tencent`, index)} addItem={(path, index) => setValue(`tencent.${index}`, {})} cleanKey={(path, key) => cleanKey(`tencent.${path}`, key)}/> + setValue(`ali.${path}`, value)} removeItem={(path, index) => removeItem(`ali`, index)} addItem={(path, index) => setValue(`ali.${index}`, {})} cleanKey={(path, key) => cleanKey(`ali.${path}`, key)}/> + setValue(`ctyun.${path}`, value)} removeItem={(path, index) => removeItem(`ctyun`, index)} addItem={(path, index) => setValue(`ctyun.${index}`, {})} cleanKey={(path, key) => cleanKey(`ctyun.${path}`, key)}/> + ); } diff --git a/es/components/config/upsert/web.pc.js b/es/components/config/upsert/web.pc.js index 117037325..429c20b29 100644 --- a/es/components/config/upsert/web.pc.js +++ b/es/components/config/upsert/web.pc.js @@ -6,10 +6,11 @@ import Cos from './cos/index'; import Map from './map/index'; import Live from './live/index'; import Sms from './sms/index'; +import Basic from './basic/index'; export default function Render(props) { const { entity, name, currentConfig, dirty } = props.data; const { resetConfig, updateConfig, setValue, removeItem, cleanKey, t } = props.methods; - const { Account: account, Cos: cos, Map: map, Live: live, Sms: sms, } = currentConfig || {}; + const { Account: account, Cos: cos, Map: map, Live: live, Sms: sms, App: app } = currentConfig || {}; return (<> @@ -62,6 +63,11 @@ export default function Render(props) { label: '短信设置', children: ( setValue(`Sms.${path}`, value)} removeItem={(path, index) => removeItem(`Sms.${path}`, index)} cleanKey={(path, key) => cleanKey(`Sms.${path}`, key)}/>), }, + { + key: '基础设置', + label: '基础设置', + children: ( setValue(`App.${path}`, value)}/>), + }, ]}> ); diff --git a/es/components/extraFile/commit/index.d.ts b/es/components/extraFile/commit/index.d.ts index 417f3f92f..52c60b59b 100644 --- a/es/components/extraFile/commit/index.d.ts +++ b/es/components/extraFile/commit/index.d.ts @@ -13,19 +13,19 @@ declare const _default: ) => unknown) | undefined; - type?: "button" | "reset" | "submit" | undefined; + type?: "button" | "submit" | "reset" | undefined; shape?: "default" | "rounded" | "rectangular" | undefined; children?: import("react").ReactNode; - } & Pick & import("react").ButtonHTMLAttributes, "id" | "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & { + } & Pick & import("react").ButtonHTMLAttributes, "id" | "onMouseDown" | "onMouseUp" | "onTouchStart" | "onTouchEnd"> & { className?: string | undefined; style?: (import("react").CSSProperties & Partial>) | undefined; tabIndex?: number | undefined; diff --git a/es/components/system/application/index.js b/es/components/system/application/index.js index abde170d8..bb42ab3fd 100644 --- a/es/components/system/application/index.js +++ b/es/components/system/application/index.js @@ -7,6 +7,8 @@ export default OakComponent({ config: 1, description: 1, type: 1, + systemId: 1, + domainId: 1, }, properties: { systemId: '', @@ -15,5 +17,5 @@ export default OakComponent({ return { applications: data || [], }; - } + }, }); diff --git a/es/components/system/application/web.pc.js b/es/components/system/application/web.pc.js index 14726c2e2..311fbf154 100644 --- a/es/components/system/application/web.pc.js +++ b/es/components/system/application/web.pc.js @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Tabs, Modal, Button } from 'antd'; +import { Tabs, Modal, Button, Space } from 'antd'; import ApplicationPanel from '../../application/panel'; import ApplicationUpsert from '../../application/upsert'; export default function render(props) { @@ -9,21 +9,29 @@ export default function render(props) { const [removeId, setRemoveId] = useState(''); if (oakFullpath && applications?.length > 0) { return (<> - { + { clean(); setCreateId(''); - }} footer={ + }> + {t('common::action.confirm')} + + }> { clean(); setRemoveId(''); - }} footer={ + }> + {t('common::action.confirm')} + + }>
diff --git a/es/components/system/panel/index.js b/es/components/system/panel/index.js index 9356bd056..5c76afa62 100644 --- a/es/components/system/panel/index.js +++ b/es/components/system/panel/index.js @@ -24,6 +24,8 @@ export default OakComponent({ config: 1, description: 1, type: 1, + systemId: 1, + domainId: 1, } } }, diff --git a/es/components/system/panel/web.pc.js b/es/components/system/panel/web.pc.js index 716ecaab1..c15d5f14a 100644 --- a/es/components/system/panel/web.pc.js +++ b/es/components/system/panel/web.pc.js @@ -8,8 +8,8 @@ import SmsTemplateList from '../../messageTypeSmsTemplate/tab'; import ApplicationList from '../application'; import Styles from './web.pc.module.less'; export default function Render(props) { - const { id, config, oakFullpath, name, style, application$system: applications } = props.data; - const { t, update, addItem, removeItem } = props.methods; + const { id, config, oakFullpath, name, style } = props.data; + const { t, } = props.methods; if (id && oakFullpath) { return (
+ tooltip="目录属性应和开发目录下的对应目录名匹配,请谨慎修改"> <> { update({ diff --git a/es/components/userEntityGrant/claim/ubPicker/index.d.ts b/es/components/userEntityGrant/claim/ubPicker/index.d.ts index 2edc2dda1..43cb819e3 100644 --- a/es/components/userEntityGrant/claim/ubPicker/index.d.ts +++ b/es/components/userEntityGrant/claim/ubPicker/index.d.ts @@ -5,8 +5,8 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entity: keyof EntityDict; entityFilter: any; relationIds: string[]; - rule: "single" | "all" | "free"; - ruleOnRow: "single" | "all" | "free"; + rule: "all" | "single" | "free"; + ruleOnRow: "all" | "single" | "free"; onPickRelations: (ids: string[]) => void; onPickRows: (ids: string[]) => void; pickedRowIds: string[] | undefined; diff --git a/es/components/userEntityGrant/upsert/index.d.ts b/es/components/userEntityGrant/upsert/index.d.ts index cd3cb5a0a..377993dcb 100644 --- a/es/components/userEntityGrant/upsert/index.d.ts +++ b/es/components/userEntityGrant/upsert/index.d.ts @@ -12,7 +12,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< claimUrl: string; qrCodeType: QrCodeType; multiple: boolean; - rule: "single" | "all" | "free"; - ruleOnRow: "single" | "all" | "free"; + rule: "all" | "single" | "free"; + ruleOnRow: "all" | "single" | "free"; }>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatLogin/qrCode/index.d.ts b/es/components/wechatLogin/qrCode/index.d.ts index 8a2c6f8ae..464b6f937 100644 --- a/es/components/wechatLogin/qrCode/index.d.ts +++ b/es/components/wechatLogin/qrCode/index.d.ts @@ -1,7 +1,7 @@ /// import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/entities/Application.d.ts b/es/entities/Application.d.ts index 451178e7b..8f7e70116 100644 --- a/es/entities/Application.d.ts +++ b/es/entities/Application.d.ts @@ -2,6 +2,7 @@ import { String, Text } from 'oak-domain/lib/types/DataType'; import { EntityShape } from 'oak-domain/lib/types/Entity'; import { Schema as System } from './System'; import { Schema as Session } from './Session'; +import { Schema as Domain } from './Domain'; import { Style } from '../types/Style'; export type Passport = 'email' | 'mobile' | 'wechat' | 'wechatPublic'; export type AppType = 'web' | 'wechatMp' | 'wechatPublic' | 'native'; @@ -63,4 +64,5 @@ export interface Schema extends EntityShape { config: WebConfig | WechatMpConfig | WechatPublicConfig | NativeConfig; style?: Style; sessions?: Session[]; + domain?: Domain; } diff --git a/es/entities/Application.js b/es/entities/Application.js index 2312c06a4..ebaaf7606 100644 --- a/es/entities/Application.js +++ b/es/entities/Application.js @@ -11,6 +11,7 @@ const entityDesc = { config: '设置', style: '样式', sessions: '会话', + domain: '域名', }, v: { type: { diff --git a/es/features/theme.d.ts b/es/features/theme.d.ts index 33c9391f0..cee255236 100644 --- a/es/features/theme.d.ts +++ b/es/features/theme.d.ts @@ -19,6 +19,6 @@ export default class Theme; config: WebConfig | WechatMpConfig | WechatPublicConfig | NativeConfig; style?: Style | null; + domainId?: ForeignKey<"domain"> | null; }; export type OpAttr = keyof OpSchema; export type Schema = EntityShape & { @@ -85,7 +87,9 @@ export type Schema = EntityShape & { systemId: ForeignKey<"system">; config: WebConfig | WechatMpConfig | WechatPublicConfig | NativeConfig; style?: Style | null; + domainId?: ForeignKey<"domain"> | null; system: System.Schema; + domain?: Domain.Schema | null; extraFile$application?: Array; extraFile$application$$aggr?: AggregationResult; notification$application?: Array; @@ -123,6 +127,8 @@ type AttrFilter = { system: System.Filter; config: JsonFilter; style: JsonFilter