diff --git a/es/aspects/application.js b/es/aspects/application.js index eda512d4a..42ef1ceb7 100644 --- a/es/aspects/application.js +++ b/es/aspects/application.js @@ -21,39 +21,32 @@ export async function getApplication(params, context) { }, {}); //微信小程序环境下 没有就报错 if (type === 'wechatMp') { - assert( - application, - '微信小程序环境下 application必须存在小程序相关配置' - ); - } else if (type === 'native') { + assert(application, '微信小程序环境下 application必须存在小程序相关配置'); + } + else if (type === 'native') { assert(application, 'APP环境下 application必须存在APP相关配置'); - } else { + } + 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, - }, + const [application2] = await context.select('application', { + data: cloneDeep(applicationProjection), + filter: { + type: 'web', + system: { + domain$system: { + url: domain, }, }, }, - {} - ); - assert( - application2, - '微信公众号环境下 application不存在公众号配置,但必须存在web相关配置' - ); + }, {}); + assert(application2, '微信公众号环境下 application不存在公众号配置,但必须存在web相关配置'); return application2.id; } - } else { + } + else { assert(application, 'web环境下 application必须存在web相关配置'); } } diff --git a/es/aspects/token.js b/es/aspects/token.js index 29f279cfc..d9a4d53c6 100644 --- a/es/aspects/token.js +++ b/es/aspects/token.js @@ -1148,24 +1148,18 @@ export async function sendCaptcha({ mobile, env, type: type2, }, context) { }, { dontCollect: true, }); - if (process.env.NODE_ENV === 'development' || mockSend) { closeRootMode(); return `验证码[${code}]已创建`; - } else { + } + else { //发送短信 - const result = await sendSms( - { - origin: 'tencent', - templateName: '登录', - mobile, - templateParam: { - code, - duration: duration.toString(), - }, - }, - context - ); + const result = await sendSms({ + origin: 'tencent', + templateName: '登录', + mobile, + templateParam: { code, duration: duration.toString() }, + }, context); closeRootMode(); if (result.success) { return '验证码已发送'; diff --git a/es/components/config/style/platform/index.d.ts b/es/components/config/style/platform/index.d.ts index 0017a6f93..bd3579c54 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) => import("react").ReactElement>; diff --git a/es/components/config/upsert/index.d.ts b/es/components/config/upsert/index.d.ts index 26655e31f..6a8e95a3d 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) => import("react").ReactElement>; diff --git a/es/components/extraFile/commit/index.d.ts b/es/components/extraFile/commit/index.d.ts index 6ae0fa0ba..7244b7015 100644 --- a/es/components/extraFile/commit/index.d.ts +++ b/es/components/extraFile/commit/index.d.ts @@ -14,17 +14,17 @@ 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" | "onTouchStart" | "onTouchEnd"> & { + } & Pick & import("react").ButtonHTMLAttributes, "id" | "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & { className?: string | undefined; style?: (import("react").CSSProperties & Partial>) | undefined; tabIndex?: number | undefined; diff --git a/es/components/userRelation/list/index.js b/es/components/userRelation/list/index.js index dd423c653..2d01056ef 100644 --- a/es/components/userRelation/list/index.js +++ b/es/components/userRelation/list/index.js @@ -26,6 +26,7 @@ export default OakComponent({ } return { id: 1, + $$createAt$$: 1, name: 1, nickname: 1, mobile$user: { @@ -91,6 +92,18 @@ export default OakComponent({ }, }; }, + sorters: [ + { + sorter() { + return { + $attr: { + $$createAt$$: 1, + }, + $direction: 'desc' + }; + }, + } + ], filters: [ { filter() { diff --git a/es/components/userRelation/upsert/byMobile/index.d.ts b/es/components/userRelation/upsert/byMobile/index.d.ts index 4459f2fa0..382f191e5 100644 --- a/es/components/userRelation/upsert/byMobile/index.d.ts +++ b/es/components/userRelation/upsert/byMobile/index.d.ts @@ -5,5 +5,6 @@ declare const _default: ) => React.ReactElement; export default _default; diff --git a/es/components/userRelation/upsert/byMobile/index.js b/es/components/userRelation/upsert/byMobile/index.js index fecf43240..86aedfdb9 100644 --- a/es/components/userRelation/upsert/byMobile/index.js +++ b/es/components/userRelation/upsert/byMobile/index.js @@ -10,7 +10,8 @@ export default OakComponent({ isList: false, formData({ data: mobile }) { const { oakFullpath } = this.state; - const userRelations = oakFullpath && this.features.runningTree.getOperations(`${oakFullpath}.user.userRelation$user`); + const userRelations = oakFullpath && + this.features.runningTree.getOperations(`${oakFullpath}.user.userRelation$user`); return { userId: mobile?.userId, legal: userRelations && userRelations.length > 0, @@ -20,6 +21,7 @@ export default OakComponent({ entity: '', entityId: '', relations: [], + passwordRequire: false, }, data: { mobileValue: '', @@ -40,7 +42,7 @@ export default OakComponent({ filter: { mobile: value, ableState: 'enabled', - } + }, }); if (data.length > 0) { this.clean(); @@ -102,6 +104,6 @@ export default OakComponent({ }, searchCancelMp() { this.onReset(); - } + }, }, }); diff --git a/es/components/userRelation/upsert/byMobile/web.d.ts b/es/components/userRelation/upsert/byMobile/web.d.ts index 83cc7f911..cf5aac1dd 100644 --- a/es/components/userRelation/upsert/byMobile/web.d.ts +++ b/es/components/userRelation/upsert/byMobile/web.d.ts @@ -8,6 +8,7 @@ export default function Render(props: WebComponentProps Promise; onConfirm: () => Promise; diff --git a/es/components/userRelation/upsert/byMobile/web.js b/es/components/userRelation/upsert/byMobile/web.js index 6babd5112..e7d0803fa 100644 --- a/es/components/userRelation/upsert/byMobile/web.js +++ b/es/components/userRelation/upsert/byMobile/web.js @@ -3,7 +3,7 @@ import { Form, Input, Button } from 'antd-mobile'; import Style from './web.module.less'; import OnUser from '../onUser/index'; export default function Render(props) { - const { mobileValue, mobileValueReady, relations, entity, entityId, userId, oakFullpath, oakExecutable, oakDirty } = props.data; + const { mobileValue, mobileValueReady, relations, entity, entityId, userId, oakFullpath, oakExecutable, oakDirty, passwordRequire, } = props.data; const { onConfirm, onMobileChange, onReset, t } = props.methods; return (