From 6c69828cc564cf1091f9601bb5729622dc7a2955 Mon Sep 17 00:00:00 2001 From: Xc Date: Sat, 18 May 2024 12:47:33 +0800 Subject: [PATCH] build --- es/aspects/token.js | 17 +- es/checkers/parasite.js | 11 +- es/components/address/list/index.d.ts | 2 +- es/components/address/upsert/index.d.ts | 2 +- es/components/application/detail/index.d.ts | 2 +- .../application/detailForPlatform/index.d.ts | 2 +- es/components/application/panel/index.d.ts | 2 +- es/components/application/upsert/index.d.ts | 2 +- es/components/article/cell/index.d.ts | 2 +- es/components/article/detail/index.d.ts | 2 +- es/components/article/preview/index.d.ts | 2 +- es/components/article/treeList/index.d.ts | 2 +- es/components/article/upsert/index.d.ts | 2 +- es/components/articleMenu/treeCell/index.d.ts | 2 +- es/components/articleMenu/treeList/index.d.ts | 2 +- .../articleMenu/treeManager/index.d.ts | 2 +- .../changePassword/byMobile/index.d.ts | 2 +- .../changePassword/byPassword/index.d.ts | 2 +- es/components/changePassword/index.d.ts | 2 +- es/components/common/tabBar/index.d.ts | 2 +- es/components/config/application/index.d.ts | 2 +- .../config/style/platform/index.d.ts | 2 +- es/components/config/upsert/index.d.ts | 2 +- es/components/domain/detail/index.d.ts | 2 +- es/components/domain/list/index.d.ts | 2 +- es/components/domain/upsert/index.d.ts | 2 +- es/components/editor/index.d.ts | 2 +- es/components/extraFile/avatar/index.d.ts | 2 +- es/components/extraFile/commit/index.d.ts | 1 - es/components/message/cell/index.d.ts | 2 +- es/components/message/detail/index.d.ts | 2 +- es/components/message/list/index.d.ts | 2 +- es/components/message/simpleList/index.d.ts | 2 +- .../messageTypeSmsTemplate/list/index.d.ts | 2 +- .../messageTypeSmsTemplate/tab/index.d.ts | 2 +- .../messageTypeTemplate/list/index.d.ts | 2 +- es/components/mobile/login/index.d.ts | 2 +- es/components/mobile/login/web.js | 6 +- es/components/mobile/login/web.pc.js | 4 +- es/components/mobile/manageList/index.d.ts | 2 +- es/components/mobile/me/index.d.ts | 4 +- es/components/mobile/me/index.js | 44 +++-- es/components/mobile/me/index.less | 7 +- es/components/mobile/me/index.xml | 6 +- es/components/mobile/me/web.pc.d.ts | 1 - es/components/mobile/me/web.pc.js | 3 +- es/components/my/avatar/index.d.ts | 2 +- es/components/my/info/index.d.ts | 2 +- es/components/my/message/index.d.ts | 2 +- es/components/paper/detail/index.d.ts | 2 +- es/components/paper/list/index.d.ts | 2 +- es/components/paper/preview/index.d.ts | 2 +- es/components/paper/upsert/index.d.ts | 2 +- es/components/parasite/detail/index.d.ts | 2 +- es/components/parasite/excess/index.d.ts | 2 +- es/components/parasite/list/index.d.ts | 2 +- es/components/pickers/area/index.d.ts | 2 +- es/components/platform/detail/index.d.ts | 2 +- es/components/platform/panel/index.d.ts | 2 +- es/components/platform/system/index.d.ts | 2 +- es/components/platform/upsert/index.d.ts | 2 +- es/components/session/cell/index.d.ts | 2 +- es/components/session/forMessage/index.d.ts | 2 +- es/components/session/header/index.d.ts | 2 +- es/components/session/list/index.d.ts | 2 +- es/components/session/list/index.js | 8 +- .../session/sessionMessage/index.d.ts | 2 +- es/components/sessionMessage/cell/index.d.ts | 2 +- es/components/sessionMessage/list/index.d.ts | 2 +- es/components/sessionMessage/list/index.js | 6 +- .../sessionMessage/upsert/index.d.ts | 2 +- .../subscription/config/upsert/index.d.ts | 2 +- es/components/subscription/detail/index.d.ts | 2 +- es/components/subscription/upsert/index.d.ts | 2 +- es/components/subwayLine/list/index.d.ts | 2 +- es/components/subwayLine/picker/index.d.ts | 2 +- .../subwayLine/upsertStation/index.d.ts | 2 +- .../subwayLine/upsertSubway/index.d.ts | 2 +- es/components/system/application/index.d.ts | 2 +- es/components/system/detail/index.d.ts | 2 +- es/components/system/panel/index.d.ts | 2 +- es/components/system/upsert/index.d.ts | 2 +- es/components/token/me/index.d.ts | 2 +- .../user/authentication/idCard/index.d.ts | 9 + .../user/authentication/idCard/index.js | 131 +++++++++++++++ .../user/authentication/idCard/index.json | 3 + .../user/authentication/idCard/index.less | 70 ++++++++ .../user/authentication/idCard/index.xml | 42 +++++ es/components/user/authentication/index.d.ts | 5 + es/components/user/authentication/index.js | 157 ++++++++++++++++++ es/components/user/authentication/index.json | 9 + es/components/user/authentication/index.less | 22 +++ es/components/user/authentication/index.xml | 18 ++ .../user/authentication/locales/zh_CN.json | 11 ++ .../user/authentication/mobile.module.less | 54 ++++++ es/components/user/authentication/web.d.ts | 13 ++ es/components/user/authentication/web.js | 104 ++++++++++++ .../user/authentication/web.module.less | 0 es/components/user/authentication/web.pc.d.ts | 6 + es/components/user/authentication/web.pc.js | 8 + es/components/user/info/index.d.ts | 2 +- es/components/user/login/index.d.ts | 2 +- es/components/user/manage/detail/index.d.ts | 2 +- es/components/user/manage/index.d.ts | 2 +- es/components/user/manage/upsert/index.d.ts | 2 +- .../userEntityGrant/claim/index.d.ts | 2 +- .../userEntityGrant/claim/ubPicker/index.d.ts | 2 +- es/components/userEntityGrant/list/index.d.ts | 2 +- .../userEntityGrant/share/index.d.ts | 2 +- .../userEntityGrant/upsert/index.d.ts | 2 +- .../userRelation/upsert/onUser/index.d.ts | 2 +- .../upsert/onUser/userRelation/index.d.ts | 2 +- es/components/userRelation/upsert/web.d.ts | 1 - es/components/userRelation/upsert/web.pc.d.ts | 1 - es/components/userWechatPublicTag/index.d.ts | 2 +- .../userWechatPublicTag/list/index.d.ts | 2 +- .../subscribedList/index.d.ts | 2 +- es/components/wechatLogin/confirm/index.d.ts | 2 +- es/components/wechatLogin/qrCode/index.d.ts | 2 +- .../wechatMaterialLibrary/index.d.ts | 2 +- .../wechatMenu/actionPhone/index.d.ts | 2 +- .../wechatMenu/conditionalMenu/index.d.ts | 2 +- es/components/wechatMenu/index.d.ts | 2 +- es/components/wechatMenu/menu/index.d.ts | 2 +- es/components/wechatMenu/menuInfo/index.d.ts | 2 +- es/components/wechatMenu/preview/index.d.ts | 2 +- .../wechatMenu/selectArticle/index.d.ts | 2 +- .../wechatMenu/selectMiniprogram/index.d.ts | 2 +- es/components/wechatMenu/showNews/index.d.ts | 2 +- es/components/wechatMenu/tagList/index.d.ts | 2 +- es/components/wechatMenu/textClick/index.d.ts | 2 +- .../wechatPublicAutoReply/index.d.ts | 2 +- .../wechatPublicAutoReply/preview/index.d.ts | 2 +- .../wechatPublicAutoReply/text/index.d.ts | 2 +- es/components/wechatPublicTag/list/index.d.ts | 2 +- .../wechatPublicTag/upsert/index.d.ts | 2 +- es/components/wechatQrCode/scan/index.d.ts | 2 +- es/components/wechatQrCode/share/index.d.ts | 2 +- .../wechatUser/bindingList/index.d.ts | 2 +- es/components/wechatUser/login/index.d.ts | 2 +- es/components/wechatUser/unbindBtn/index.d.ts | 2 +- es/context/BackendRuntimeContext.d.ts | 5 + es/context/BackendRuntimeContext.js | 100 +++++++---- es/data/i18n.js | 18 ++ es/entities/User.js | 34 ++-- es/features/token.js | 4 +- es/oak-app-domain/User/Storage.js | 8 +- es/oak-app-domain/User/Style.js | 4 +- es/oak-app-domain/User/locales/zh_CN.json | 2 +- es/triggers/userEntityGrant.js | 2 +- es/types/Exception.d.ts | 3 + es/types/Exception.js | 11 +- lib/aspects/token.js | 13 +- lib/checkers/parasite.js | 11 +- lib/context/BackendRuntimeContext.d.ts | 5 + lib/context/BackendRuntimeContext.js | 36 ++++ lib/data/i18n.js | 18 ++ lib/entities/User.js | 34 ++-- lib/features/token.js | 2 +- lib/oak-app-domain/User/Storage.js | 8 +- lib/oak-app-domain/User/Style.js | 4 +- lib/oak-app-domain/User/locales/zh_CN.json | 2 +- lib/triggers/userEntityGrant.js | 2 +- lib/types/Exception.d.ts | 3 + lib/types/Exception.js | 14 +- src/checkers/parasite.ts | 11 +- src/components/session/list/index.ts | 8 +- src/components/sessionMessage/list/index.ts | 6 +- .../user/authentication/idCard/index.ts | 3 +- src/context/BackendRuntimeContext.ts | 27 ++- src/data/i18n.ts | 18 ++ src/types/Exception.ts | 1 + 172 files changed, 1119 insertions(+), 298 deletions(-) create mode 100644 es/components/user/authentication/idCard/index.d.ts create mode 100644 es/components/user/authentication/idCard/index.js create mode 100644 es/components/user/authentication/idCard/index.json create mode 100644 es/components/user/authentication/idCard/index.less create mode 100644 es/components/user/authentication/idCard/index.xml create mode 100644 es/components/user/authentication/index.d.ts create mode 100644 es/components/user/authentication/index.js create mode 100644 es/components/user/authentication/index.json create mode 100644 es/components/user/authentication/index.less create mode 100644 es/components/user/authentication/index.xml create mode 100644 es/components/user/authentication/locales/zh_CN.json create mode 100644 es/components/user/authentication/mobile.module.less create mode 100644 es/components/user/authentication/web.d.ts create mode 100644 es/components/user/authentication/web.js create mode 100644 es/components/user/authentication/web.module.less create mode 100644 es/components/user/authentication/web.pc.d.ts create mode 100644 es/components/user/authentication/web.pc.js diff --git a/es/aspects/token.js b/es/aspects/token.js index f7198f367..e645a2132 100644 --- a/es/aspects/token.js +++ b/es/aspects/token.js @@ -1,14 +1,14 @@ import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid'; import WechatSDK from 'oak-external-sdk/lib/WechatSDK'; import { assert } from 'oak-domain/lib/utils/assert'; -import { OakRowInconsistencyException, OakUnloggedInException, OakUserException, OakUserUnpermittedException, } from 'oak-domain/lib/types'; +import { OakPreConditionUnsetException, OakRowInconsistencyException, OakUnloggedInException, OakUserException, OakUserUnpermittedException, } from 'oak-domain/lib/types'; import { composeFileUrl } from '../utils/cos'; import { OakChangeLoginWayException, OakDistinguishUserException, OakUserDisabledException, } from '../types/Exception'; import { encryptPasswordSha1 } from '../utils/password'; import { tokenProjection } from '../types/Projection'; import { sendSms } from '../utils/sms'; import { mergeUser } from './user'; -import { cloneDeep, pick } from 'oak-domain/lib/utils/lodash'; +import { cloneDeep } from 'oak-domain/lib/utils/lodash'; async function makeDistinguishException(userId, context, message) { const [user] = await context.select('user', { data: { @@ -1189,7 +1189,7 @@ export async function switchTo({ userId }, context) { } const currentUserId = context.getCurrentUserId(); if (currentUserId === userId) { - throw new OakRowInconsistencyException(undefined, '您已经是当前用户'); + throw new OakPreConditionUnsetException('您已经是当前用户'); } const token = context.getToken(); await context.operate('token', { @@ -1265,14 +1265,9 @@ export async function wakeupParasite(params, context) { }, }, { dontCollect: true }); if (parasite.expired) { - throw new OakRowInconsistencyException({ - a: 's', - d: { - parasite: { - [id]: pick(parasite, ['id', 'expired']), - }, - }, - }, '数据已经过期'); + const e = new OakRowInconsistencyException('数据已经过期'); + e.addData('parasite', [parasite]); + throw e; } if (parasite.user?.userState !== 'shadow') { throw new OakUserException('此用户已经登录过系统,不允许借用身份'); diff --git a/es/checkers/parasite.js b/es/checkers/parasite.js index e0f4b869c..742297da5 100644 --- a/es/checkers/parasite.js +++ b/es/checkers/parasite.js @@ -23,14 +23,9 @@ const checkers = [ const checkUser = (users) => { const [user] = users; if (user.userState !== 'shadow') { - throw new OakRowInconsistencyException({ - a: 's', - d: { - user: { - [user.id]: user, - }, - }, - }); + const e = new OakRowInconsistencyException(); + e.addData('user', [user]); + throw e; } }; if (users2 instanceof Promise) { diff --git a/es/components/address/list/index.d.ts b/es/components/address/list/index.d.ts index eb7c9c471..3a8805399 100644 --- a/es/components/address/list/index.d.ts +++ b/es/components/address/list/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/address/upsert/index.d.ts b/es/components/address/upsert/index.d.ts index 543b66d91..81555dcf4 100644 --- a/es/components/address/upsert/index.d.ts +++ b/es/components/address/upsert/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/application/detail/index.d.ts b/es/components/application/detail/index.d.ts index f1528b757..950310deb 100644 --- a/es/components/application/detail/index.d.ts +++ b/es/components/application/detail/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/application/detailForPlatform/index.d.ts b/es/components/application/detailForPlatform/index.d.ts index f1528b757..950310deb 100644 --- a/es/components/application/detailForPlatform/index.d.ts +++ b/es/components/application/detailForPlatform/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/application/panel/index.d.ts b/es/components/application/panel/index.d.ts index f1528b757..950310deb 100644 --- a/es/components/application/panel/index.d.ts +++ b/es/components/application/panel/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/application/upsert/index.d.ts b/es/components/application/upsert/index.d.ts index f0ad771b5..4bd827e96 100644 --- a/es/components/application/upsert/index.d.ts +++ b/es/components/application/upsert/index.d.ts @@ -1,4 +1,4 @@ /// import { EntityDict } from '../../../oak-app-domain'; -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/article/cell/index.d.ts b/es/components/article/cell/index.d.ts index 7e54e8a64..11cbecb5d 100644 --- a/es/components/article/cell/index.d.ts +++ b/es/components/article/cell/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/article/detail/index.d.ts b/es/components/article/detail/index.d.ts index 7e54e8a64..11cbecb5d 100644 --- a/es/components/article/detail/index.d.ts +++ b/es/components/article/detail/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/article/preview/index.d.ts b/es/components/article/preview/index.d.ts index 7e54e8a64..11cbecb5d 100644 --- a/es/components/article/preview/index.d.ts +++ b/es/components/article/preview/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/article/treeList/index.d.ts b/es/components/article/treeList/index.d.ts index 2499768af..791c71079 100644 --- a/es/components/article/treeList/index.d.ts +++ b/es/components/article/treeList/index.d.ts @@ -15,5 +15,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< articleId: string; currentArticle: string; setCurrentArticle: (id: string) => void; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/article/upsert/index.d.ts b/es/components/article/upsert/index.d.ts index 2e9d9680b..d40a637bb 100644 --- a/es/components/article/upsert/index.d.ts +++ b/es/components/article/upsert/index.d.ts @@ -2,5 +2,5 @@ import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps void; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/articleMenu/treeCell/index.d.ts b/es/components/articleMenu/treeCell/index.d.ts index a118fce4d..0d9fea429 100644 --- a/es/components/articleMenu/treeCell/index.d.ts +++ b/es/components/articleMenu/treeCell/index.d.ts @@ -22,5 +22,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< }) => void; currentArticle: string; setCurrentArticle: (id: string) => void; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/articleMenu/treeList/index.d.ts b/es/components/articleMenu/treeList/index.d.ts index b2daa7d12..0c49cd336 100644 --- a/es/components/articleMenu/treeList/index.d.ts +++ b/es/components/articleMenu/treeList/index.d.ts @@ -29,5 +29,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< }) => void; currentArticle: string; setCurrentArticle: (id: string) => void; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/articleMenu/treeManager/index.d.ts b/es/components/articleMenu/treeManager/index.d.ts index 28eeb71d6..dc310e62e 100644 --- a/es/components/articleMenu/treeManager/index.d.ts +++ b/es/components/articleMenu/treeManager/index.d.ts @@ -4,5 +4,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< show: string; articleMenuId: string; articleId: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/changePassword/byMobile/index.d.ts b/es/components/changePassword/byMobile/index.d.ts index 9e6eb4aca..a156771c1 100644 --- a/es/components/changePassword/byMobile/index.d.ts +++ b/es/components/changePassword/byMobile/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/changePassword/byPassword/index.d.ts b/es/components/changePassword/byPassword/index.d.ts index 9e6eb4aca..a156771c1 100644 --- a/es/components/changePassword/byPassword/index.d.ts +++ b/es/components/changePassword/byPassword/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/changePassword/index.d.ts b/es/components/changePassword/index.d.ts index 8dde0b6bd..720962b50 100644 --- a/es/components/changePassword/index.d.ts +++ b/es/components/changePassword/index.d.ts @@ -1,4 +1,4 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/common/tabBar/index.d.ts b/es/components/common/tabBar/index.d.ts index 97fd2535a..c56abc303 100644 --- a/es/components/common/tabBar/index.d.ts +++ b/es/components/common/tabBar/index.d.ts @@ -17,5 +17,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< border: boolean; selectedIconPath: string; iconPath: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/config/application/index.d.ts b/es/components/config/application/index.d.ts index 5bf5d66e3..14aff74fd 100644 --- a/es/components/config/application/index.d.ts +++ b/es/components/config/application/index.d.ts @@ -8,5 +8,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entityId: string; type: string; isService: boolean; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/config/style/platform/index.d.ts b/es/components/config/style/platform/index.d.ts index 8835a6c5f..bd3579c54 100644 --- a/es/components/config/style/platform/index.d.ts +++ b/es/components/config/style/platform/index.d.ts @@ -4,5 +4,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entity: "application" | "system" | "platform"; entityId: string; name: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/config/upsert/index.d.ts b/es/components/config/upsert/index.d.ts index a4b61c5c2..6a8e95a3d 100644 --- a/es/components/config/upsert/index.d.ts +++ b/es/components/config/upsert/index.d.ts @@ -4,5 +4,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entity: "system" | "platform"; name: string; entityId: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/domain/detail/index.d.ts b/es/components/domain/detail/index.d.ts index a7112bd2e..1d9217ba1 100644 --- a/es/components/domain/detail/index.d.ts +++ b/es/components/domain/detail/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/domain/list/index.d.ts b/es/components/domain/list/index.d.ts index 95639f0bc..9210d251f 100644 --- a/es/components/domain/list/index.d.ts +++ b/es/components/domain/list/index.d.ts @@ -1,4 +1,4 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/domain/upsert/index.d.ts b/es/components/domain/upsert/index.d.ts index a7112bd2e..1d9217ba1 100644 --- a/es/components/domain/upsert/index.d.ts +++ b/es/components/domain/upsert/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/editor/index.d.ts b/es/components/editor/index.d.ts index 6424a23b3..6a8638c06 100644 --- a/es/components/editor/index.d.ts +++ b/es/components/editor/index.d.ts @@ -12,5 +12,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entityId: string; tag1: string; tag2: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/extraFile/avatar/index.d.ts b/es/components/extraFile/avatar/index.d.ts index 4e84fe12c..4caacd42b 100644 --- a/es/components/extraFile/avatar/index.d.ts +++ b/es/components/extraFile/avatar/index.d.ts @@ -4,5 +4,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entity: keyof EntityDict; entityId: string; autoUpload: boolean; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/extraFile/commit/index.d.ts b/es/components/extraFile/commit/index.d.ts index 6aaf1df05..004f431ef 100644 --- a/es/components/extraFile/commit/index.d.ts +++ b/es/components/extraFile/commit/index.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../oak-app-domain'; import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity'; import { ReactComponentProps } from 'oak-frontend-base/lib/types/Page'; diff --git a/es/components/message/cell/index.d.ts b/es/components/message/cell/index.d.ts index 4243aadc6..97cf95bf1 100644 --- a/es/components/message/cell/index.d.ts +++ b/es/components/message/cell/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/message/detail/index.d.ts b/es/components/message/detail/index.d.ts index b6a428c8d..1010f95bb 100644 --- a/es/components/message/detail/index.d.ts +++ b/es/components/message/detail/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/message/list/index.d.ts b/es/components/message/list/index.d.ts index 7d50f35ad..cf6ec7609 100644 --- a/es/components/message/list/index.d.ts +++ b/es/components/message/list/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/message/simpleList/index.d.ts b/es/components/message/simpleList/index.d.ts index abd90f921..ddcb9dc96 100644 --- a/es/components/message/simpleList/index.d.ts +++ b/es/components/message/simpleList/index.d.ts @@ -1,4 +1,4 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps void) | undefined; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/messageTypeSmsTemplate/list/index.d.ts b/es/components/messageTypeSmsTemplate/list/index.d.ts index 04dad4e71..04bc0cc22 100644 --- a/es/components/messageTypeSmsTemplate/list/index.d.ts +++ b/es/components/messageTypeSmsTemplate/list/index.d.ts @@ -2,5 +2,5 @@ import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/messageTypeSmsTemplate/tab/index.d.ts b/es/components/messageTypeSmsTemplate/tab/index.d.ts index dfbf38926..0151e0c36 100644 --- a/es/components/messageTypeSmsTemplate/tab/index.d.ts +++ b/es/components/messageTypeSmsTemplate/tab/index.d.ts @@ -1,5 +1,5 @@ import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/messageTypeTemplate/list/index.d.ts b/es/components/messageTypeTemplate/list/index.d.ts index 905b83c1c..fa7ff81d2 100644 --- a/es/components/messageTypeTemplate/list/index.d.ts +++ b/es/components/messageTypeTemplate/list/index.d.ts @@ -1,5 +1,5 @@ import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/mobile/login/index.d.ts b/es/components/mobile/login/index.d.ts index c5b493c7e..74eb451be 100644 --- a/es/components/mobile/login/index.d.ts +++ b/es/components/mobile/login/index.d.ts @@ -3,5 +3,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< onlyPassword: boolean; eventLoggedIn: string; callback: (() => void) | undefined; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/mobile/login/web.js b/es/components/mobile/login/web.js index a05fea5b1..c517a11a5 100644 --- a/es/components/mobile/login/web.js +++ b/es/components/mobile/login/web.js @@ -9,7 +9,7 @@ export default function render(props) { const validMobile = isMobile(mobile); const validCaptcha = isCaptcha(captcha); const allowSubmit = validMobile && validCaptcha; - const LoginCaptcha = (
+ const Captcha = ( } placeholder={t('placeholder.Mobile')} size="large" onChange={(e) => { setMobile(e.target.value); @@ -37,9 +37,7 @@ export default function render(props) { 为了更好的体验,请绑定手机号
-
- {LoginCaptcha} -
+
{Captcha}
); diff --git a/es/components/mobile/login/web.pc.js b/es/components/mobile/login/web.pc.js index 694e365e9..254129643 100644 --- a/es/components/mobile/login/web.pc.js +++ b/es/components/mobile/login/web.pc.js @@ -9,7 +9,7 @@ export default function render(props) { const validMobile = isMobile(mobile); const validCaptcha = isCaptcha(captcha); const allowSubmit = validMobile && validCaptcha; - const LoginCaptcha = ( + const Captcha = ( } placeholder={t('placeholder.Mobile')} size="large" onChange={(e) => { setMobile(e.target.value); @@ -38,7 +38,7 @@ export default function render(props) {
- {LoginCaptcha} + {Captcha}
diff --git a/es/components/mobile/manageList/index.d.ts b/es/components/mobile/manageList/index.d.ts index 1423e77bb..c541ac9fe 100644 --- a/es/components/mobile/manageList/index.d.ts +++ b/es/components/mobile/manageList/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/mobile/me/index.d.ts b/es/components/mobile/me/index.d.ts index 1e70baa84..e35b929cf 100644 --- a/es/components/mobile/me/index.d.ts +++ b/es/components/mobile/me/index.d.ts @@ -1,4 +1,4 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; + onFinish: (() => void) | undefined; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/mobile/me/index.js b/es/components/mobile/me/index.js index fc2e5cfce..e3c6bca2f 100644 --- a/es/components/mobile/me/index.js +++ b/es/components/mobile/me/index.js @@ -1,3 +1,4 @@ +import { OakUserDisabledException } from '../../../types/Exception'; export default OakComponent({ entity: 'mobile', isList: true, @@ -10,7 +11,6 @@ export default OakComponent({ filters: [ { filter() { - // const token = this.features.token.getToken(); const userId = this.features.token.getUserId(); return { userId, @@ -33,41 +33,59 @@ export default OakComponent({ deleteIdx: undefined, }, properties: { - showBack: false, + onFinish: undefined }, methods: { async onRefreshMobile(e) { + const { onFinish } = this.props; this.setState({ refreshing: true, }); try { const { code, errMsg } = e.detail; if (errMsg !== 'getPhoneNumber:ok') { - console.error(errMsg); - this.setMessage({ - title: '获取手机号失败', - type: 'warning', - }); + // 用户拒绝不用管 + console.warn(errMsg); + if (errMsg !== 'getPhoneNumber:fail user deny') { + this.setMessage({ + content: '获取手机号失败', + type: 'warning', + }); + return; + } } else { - await this.features.token.getWechatMpUserPhoneNumber(code); + // await this.features.token.getWechatMpUserPhoneNumber(code); + if (onFinish) { + onFinish(); + } + else if (process.env.OAK_PLATFORM === 'wechatMp') { + this.triggerEvent('finish', {}); + } } } catch (err) { console.error(err); + if (err instanceof OakUserDisabledException) { + this.setMessage({ + content: err?.message, + type: 'error', + }); + } + else { + this.setMessage({ + content: err?.message || '获取手机号错误', + type: 'error', + }); + } } this.setState({ refreshing: false, }); }, goAddMobile() { - const eventLoggedIn = `mobile:me:login:${Date.now()}`; - this.subEvent(eventLoggedIn, () => { - this.navigateBack(); - }); this.navigateTo({ url: '/mobile/login', - eventLoggedIn, }); }, async onRemoveConfirm() { diff --git a/es/components/mobile/me/index.less b/es/components/mobile/me/index.less index 322711218..40320e03a 100644 --- a/es/components/mobile/me/index.less +++ b/es/components/mobile/me/index.less @@ -1,16 +1,11 @@ -/** index.wxss **/ -@import "../../../config/styles/mp/index.less"; -@import "../../../config/styles/mp/mixins.less"; .page-body { - height: 100vh; + height: 100%; display: flex; flex: 1; flex-direction: column; box-sizing: border-box; align-items: stretch; - background-color: @oak-bg-color-page; - .safe-area-inset-bottom(); } .container { diff --git a/es/components/mobile/me/index.xml b/es/components/mobile/me/index.xml index 1a9d50b77..cf8ac2537 100644 --- a/es/components/mobile/me/index.xml +++ b/es/components/mobile/me/index.xml @@ -18,14 +18,14 @@ - 您尚未授权手机号 + 您尚未授权手机号 - - 授权手机号 + + 授权手机号 diff --git a/es/components/mobile/me/web.pc.d.ts b/es/components/mobile/me/web.pc.d.ts index 05dab0a47..28ca38ab5 100644 --- a/es/components/mobile/me/web.pc.d.ts +++ b/es/components/mobile/me/web.pc.d.ts @@ -4,7 +4,6 @@ import { EntityDict } from '../../../oak-app-domain'; export default function render(props: WebComponentProps void; diff --git a/es/components/mobile/me/web.pc.js b/es/components/mobile/me/web.pc.js index 665f59b9d..13941d426 100644 --- a/es/components/mobile/me/web.pc.js +++ b/es/components/mobile/me/web.pc.js @@ -3,10 +3,9 @@ import { List, Button, Modal, Row, Col } from 'antd'; import { MobileOutlined, DeleteOutlined } from '@ant-design/icons'; import MobileLogin from '../login'; export default function render(props) { - const { mobiles, allowRemove, tokenMobileId, showBack = false } = props.data; + const { mobiles, allowRemove, tokenMobileId } = props.data; const { goAddMobile, removeItem, recoverItem, execute } = props.methods; const [open, setOpen] = useState(false); - const eventLoggedIn = `user:info:login:${Date.now()}`; return (<> + // + // + // + // ); +} diff --git a/es/components/user/authentication/web.module.less b/es/components/user/authentication/web.module.less new file mode 100644 index 000000000..e69de29bb diff --git a/es/components/user/authentication/web.pc.d.ts b/es/components/user/authentication/web.pc.d.ts new file mode 100644 index 000000000..de37c0e31 --- /dev/null +++ b/es/components/user/authentication/web.pc.d.ts @@ -0,0 +1,6 @@ +import React from 'react'; +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../oak-app-domain'; +export default function Render(props: WebComponentProps): React.JSX.Element; diff --git a/es/components/user/authentication/web.pc.js b/es/components/user/authentication/web.pc.js new file mode 100644 index 000000000..28b8cedbd --- /dev/null +++ b/es/components/user/authentication/web.pc.js @@ -0,0 +1,8 @@ +import React from 'react'; +import Styles from './web.module.less'; +export default function Render(props) { + const { methods, data } = props; + const { t } = methods; + const { oakFullpath, oakId, oakLegalActions, avatar } = data; + return
; +} diff --git a/es/components/user/info/index.d.ts b/es/components/user/info/index.d.ts index 9e6eb4aca..a156771c1 100644 --- a/es/components/user/info/index.d.ts +++ b/es/components/user/info/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/user/login/index.d.ts b/es/components/user/login/index.d.ts index b0c093100..32539219a 100644 --- a/es/components/user/login/index.d.ts +++ b/es/components/user/login/index.d.ts @@ -3,5 +3,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< onlyPassword: boolean; disabled: string; redirectUri: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/user/manage/detail/index.d.ts b/es/components/user/manage/detail/index.d.ts index 2e7a3635e..076512a32 100644 --- a/es/components/user/manage/detail/index.d.ts +++ b/es/components/user/manage/detail/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/user/manage/index.d.ts b/es/components/user/manage/index.d.ts index d33500b73..53c36f819 100644 --- a/es/components/user/manage/index.d.ts +++ b/es/components/user/manage/index.d.ts @@ -1,4 +1,4 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/user/manage/upsert/index.d.ts b/es/components/user/manage/upsert/index.d.ts index 88ed45721..be08db540 100644 --- a/es/components/user/manage/upsert/index.d.ts +++ b/es/components/user/manage/upsert/index.d.ts @@ -1,4 +1,4 @@ /// import { EntityDict } from "../../../../oak-app-domain"; -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/userEntityGrant/claim/index.d.ts b/es/components/userEntityGrant/claim/index.d.ts index dd836cbe0..d17d81093 100644 --- a/es/components/userEntityGrant/claim/index.d.ts +++ b/es/components/userEntityGrant/claim/index.d.ts @@ -16,5 +16,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< hideInfo: boolean; hideTip: boolean; afterClaim: ((ueg: EntityDict['userEntityGrant']['OpSchema']) => void) | undefined; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/userEntityGrant/claim/ubPicker/index.d.ts b/es/components/userEntityGrant/claim/ubPicker/index.d.ts index 3ff190b84..b29d102ca 100644 --- a/es/components/userEntityGrant/claim/ubPicker/index.d.ts +++ b/es/components/userEntityGrant/claim/ubPicker/index.d.ts @@ -10,5 +10,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< onPickRows: (ids: string[]) => void; pickedRowIds: string[] | undefined; pickedRelationIds: string[] | undefined; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/userEntityGrant/list/index.d.ts b/es/components/userEntityGrant/list/index.d.ts index d5a513a61..173b46388 100644 --- a/es/components/userEntityGrant/list/index.d.ts +++ b/es/components/userEntityGrant/list/index.d.ts @@ -3,5 +3,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entityId: string; relationEntity: string; relationEntityFilter: {}; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/userEntityGrant/share/index.d.ts b/es/components/userEntityGrant/share/index.d.ts index e04f8057f..b7bbd6ff7 100644 --- a/es/components/userEntityGrant/share/index.d.ts +++ b/es/components/userEntityGrant/share/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/userEntityGrant/upsert/index.d.ts b/es/components/userEntityGrant/upsert/index.d.ts index 5a575ac50..960926763 100644 --- a/es/components/userEntityGrant/upsert/index.d.ts +++ b/es/components/userEntityGrant/upsert/index.d.ts @@ -13,5 +13,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< multiple: boolean; rule: "single" | "all" | "free"; ruleOnRow: "single" | "all" | "free"; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/userRelation/upsert/onUser/index.d.ts b/es/components/userRelation/upsert/onUser/index.d.ts index 7f421cd1b..ff878210b 100644 --- a/es/components/userRelation/upsert/onUser/index.d.ts +++ b/es/components/userRelation/upsert/onUser/index.d.ts @@ -9,5 +9,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< allowUpdateName: boolean; allowUpdateNickname: boolean; isNew: boolean; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/userRelation/upsert/onUser/userRelation/index.d.ts b/es/components/userRelation/upsert/onUser/userRelation/index.d.ts index 8a88eb02e..7030510f7 100644 --- a/es/components/userRelation/upsert/onUser/userRelation/index.d.ts +++ b/es/components/userRelation/upsert/onUser/userRelation/index.d.ts @@ -3,5 +3,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entity: keyof EntityDict; entityId: string; relations: import("../../../../../oak-app-domain/Relation/Schema").OpSchema[]; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/userRelation/upsert/web.d.ts b/es/components/userRelation/upsert/web.d.ts index 9a693f5e4..59df5f4b7 100644 --- a/es/components/userRelation/upsert/web.d.ts +++ b/es/components/userRelation/upsert/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../oak-app-domain'; import { QrCodeType } from '../../../types/Config'; diff --git a/es/components/userRelation/upsert/web.pc.d.ts b/es/components/userRelation/upsert/web.pc.d.ts index 45795c977..ac1d06326 100644 --- a/es/components/userRelation/upsert/web.pc.d.ts +++ b/es/components/userRelation/upsert/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../oak-app-domain'; import { QrCodeType } from '../../../types/Config'; diff --git a/es/components/userWechatPublicTag/index.d.ts b/es/components/userWechatPublicTag/index.d.ts index 61894f44c..4d39ecf8f 100644 --- a/es/components/userWechatPublicTag/index.d.ts +++ b/es/components/userWechatPublicTag/index.d.ts @@ -1,4 +1,4 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/userWechatPublicTag/list/index.d.ts b/es/components/userWechatPublicTag/list/index.d.ts index 4a745109d..f1c9a3614 100644 --- a/es/components/userWechatPublicTag/list/index.d.ts +++ b/es/components/userWechatPublicTag/list/index.d.ts @@ -1,5 +1,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/userWechatPublicTag/subscribedList/index.d.ts b/es/components/userWechatPublicTag/subscribedList/index.d.ts index 78c814bb6..7a0670531 100644 --- a/es/components/userWechatPublicTag/subscribedList/index.d.ts +++ b/es/components/userWechatPublicTag/subscribedList/index.d.ts @@ -1,4 +1,4 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatLogin/confirm/index.d.ts b/es/components/wechatLogin/confirm/index.d.ts index 7e6f4d539..11d2f3f62 100644 --- a/es/components/wechatLogin/confirm/index.d.ts +++ b/es/components/wechatLogin/confirm/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => 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 3b3d78760..69727bd4d 100644 --- a/es/components/wechatLogin/qrCode/index.d.ts +++ b/es/components/wechatLogin/qrCode/index.d.ts @@ -2,5 +2,5 @@ import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMaterialLibrary/index.d.ts b/es/components/wechatMaterialLibrary/index.d.ts index 333c8caf1..f07e65ee4 100644 --- a/es/components/wechatMaterialLibrary/index.d.ts +++ b/es/components/wechatMaterialLibrary/index.d.ts @@ -3,5 +3,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< type: MaterialType; getMenuContent: (menuContent: any) => void; applicationId: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMenu/actionPhone/index.d.ts b/es/components/wechatMenu/actionPhone/index.d.ts index 8e80303bf..f41a49dad 100644 --- a/es/components/wechatMenu/actionPhone/index.d.ts +++ b/es/components/wechatMenu/actionPhone/index.d.ts @@ -11,5 +11,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< isPreview: boolean; open: boolean; tabKey: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMenu/conditionalMenu/index.d.ts b/es/components/wechatMenu/conditionalMenu/index.d.ts index e0873726d..cc184c883 100644 --- a/es/components/wechatMenu/conditionalMenu/index.d.ts +++ b/es/components/wechatMenu/conditionalMenu/index.d.ts @@ -4,5 +4,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< wechatId: string; menuType: string; tabKey: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMenu/index.d.ts b/es/components/wechatMenu/index.d.ts index 68181acca..4a60856f3 100644 --- a/es/components/wechatMenu/index.d.ts +++ b/es/components/wechatMenu/index.d.ts @@ -2,5 +2,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< applicationId: string; isPlatform: boolean; tabKey: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMenu/menu/index.d.ts b/es/components/wechatMenu/menu/index.d.ts index 9911a9a61..57b2e6ca2 100644 --- a/es/components/wechatMenu/menu/index.d.ts +++ b/es/components/wechatMenu/menu/index.d.ts @@ -3,5 +3,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< menuId: string; menuType: string; tabKey: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMenu/menuInfo/index.d.ts b/es/components/wechatMenu/menuInfo/index.d.ts index f7b3a780b..d17740e46 100644 --- a/es/components/wechatMenu/menuInfo/index.d.ts +++ b/es/components/wechatMenu/menuInfo/index.d.ts @@ -19,5 +19,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< actions: string[]; wechatId: string; iState: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMenu/preview/index.d.ts b/es/components/wechatMenu/preview/index.d.ts index a7c9dd34d..7f6e29809 100644 --- a/es/components/wechatMenu/preview/index.d.ts +++ b/es/components/wechatMenu/preview/index.d.ts @@ -2,5 +2,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< button: any[]; news: any[]; applicationId: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMenu/selectArticle/index.d.ts b/es/components/wechatMenu/selectArticle/index.d.ts index 3b94218e6..1f5701d44 100644 --- a/es/components/wechatMenu/selectArticle/index.d.ts +++ b/es/components/wechatMenu/selectArticle/index.d.ts @@ -2,5 +2,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< getUrl: (url: string) => void; changeOpen: (open: boolean) => void; applicationId: string; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMenu/selectMiniprogram/index.d.ts b/es/components/wechatMenu/selectMiniprogram/index.d.ts index b3ba152eb..34f5a1ee8 100644 --- a/es/components/wechatMenu/selectMiniprogram/index.d.ts +++ b/es/components/wechatMenu/selectMiniprogram/index.d.ts @@ -1,5 +1,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps void; changeOpen: (open: boolean) => void; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMenu/showNews/index.d.ts b/es/components/wechatMenu/showNews/index.d.ts index 528a9f359..a76aa8442 100644 --- a/es/components/wechatMenu/showNews/index.d.ts +++ b/es/components/wechatMenu/showNews/index.d.ts @@ -1,4 +1,4 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMenu/tagList/index.d.ts b/es/components/wechatMenu/tagList/index.d.ts index 3933a080b..c8823ae2b 100644 --- a/es/components/wechatMenu/tagList/index.d.ts +++ b/es/components/wechatMenu/tagList/index.d.ts @@ -6,5 +6,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< name: string; wechatId: string; }) => void; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatMenu/textClick/index.d.ts b/es/components/wechatMenu/textClick/index.d.ts index a0e6be8d3..5cfc90a07 100644 --- a/es/components/wechatMenu/textClick/index.d.ts +++ b/es/components/wechatMenu/textClick/index.d.ts @@ -1,5 +1,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps void; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatPublicAutoReply/index.d.ts b/es/components/wechatPublicAutoReply/index.d.ts index 2fafe318c..5afaff8f9 100644 --- a/es/components/wechatPublicAutoReply/index.d.ts +++ b/es/components/wechatPublicAutoReply/index.d.ts @@ -1,5 +1,5 @@ import { EntityDict } from '../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatPublicAutoReply/preview/index.d.ts b/es/components/wechatPublicAutoReply/preview/index.d.ts index 3a000f956..de1d5f00d 100644 --- a/es/components/wechatPublicAutoReply/preview/index.d.ts +++ b/es/components/wechatPublicAutoReply/preview/index.d.ts @@ -7,5 +7,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< video: string; voice: string; }; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatPublicAutoReply/text/index.d.ts b/es/components/wechatPublicAutoReply/text/index.d.ts index dd3519d90..3e93c18a5 100644 --- a/es/components/wechatPublicAutoReply/text/index.d.ts +++ b/es/components/wechatPublicAutoReply/text/index.d.ts @@ -1,5 +1,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps void; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatPublicTag/list/index.d.ts b/es/components/wechatPublicTag/list/index.d.ts index be53cb08c..eea49a877 100644 --- a/es/components/wechatPublicTag/list/index.d.ts +++ b/es/components/wechatPublicTag/list/index.d.ts @@ -1,4 +1,4 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatPublicTag/upsert/index.d.ts b/es/components/wechatPublicTag/upsert/index.d.ts index 501e73530..2aa8c6dd0 100644 --- a/es/components/wechatPublicTag/upsert/index.d.ts +++ b/es/components/wechatPublicTag/upsert/index.d.ts @@ -7,5 +7,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< editTag: () => void; addTag: () => void; changeText: (text: string) => void; -}>) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatQrCode/scan/index.d.ts b/es/components/wechatQrCode/scan/index.d.ts index 81a2c248e..c322195a6 100644 --- a/es/components/wechatQrCode/scan/index.d.ts +++ b/es/components/wechatQrCode/scan/index.d.ts @@ -1,5 +1,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +}>) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatQrCode/share/index.d.ts b/es/components/wechatQrCode/share/index.d.ts index 14f3713ef..0ee7d6c0c 100644 --- a/es/components/wechatQrCode/share/index.d.ts +++ b/es/components/wechatQrCode/share/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatUser/bindingList/index.d.ts b/es/components/wechatUser/bindingList/index.d.ts index ab29006fe..9394adf2c 100644 --- a/es/components/wechatUser/bindingList/index.d.ts +++ b/es/components/wechatUser/bindingList/index.d.ts @@ -1,4 +1,4 @@ /// import { EntityDict } from '../../../oak-app-domain'; -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatUser/login/index.d.ts b/es/components/wechatUser/login/index.d.ts index 4007eded7..a16fbf16b 100644 --- a/es/components/wechatUser/login/index.d.ts +++ b/es/components/wechatUser/login/index.d.ts @@ -1,3 +1,3 @@ /// -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/wechatUser/unbindBtn/index.d.ts b/es/components/wechatUser/unbindBtn/index.d.ts index 611b25119..841d0c766 100644 --- a/es/components/wechatUser/unbindBtn/index.d.ts +++ b/es/components/wechatUser/unbindBtn/index.d.ts @@ -1,4 +1,4 @@ /// import { EntityDict } from '../../../oak-app-domain'; -declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; +declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/context/BackendRuntimeContext.d.ts b/es/context/BackendRuntimeContext.d.ts index dbed9893d..f7f6b3f0a 100644 --- a/es/context/BackendRuntimeContext.d.ts +++ b/es/context/BackendRuntimeContext.d.ts @@ -30,4 +30,9 @@ export declare abstract class BackendRuntimeContext>; allowUserUpdate(): boolean; + /** + * 获得当前系统的访问路径,根据application/system/domain之间的关联 + * http://www.xxx.com/oak-api + */ + composeAccessPath(): string; } diff --git a/es/context/BackendRuntimeContext.js b/es/context/BackendRuntimeContext.js index ed031e6ca..4ad8138fe 100644 --- a/es/context/BackendRuntimeContext.js +++ b/es/context/BackendRuntimeContext.js @@ -6,7 +6,8 @@ import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid'; import { applicationProjection } from '../types/Projection'; import { getMpUnlimitWxaCode } from '../aspects/wechatQrCode'; import { BackendRuntimeContext as BRC } from 'oak-frontend-base'; -import { cloneDeep } from 'oak-domain/lib/utils/lodash'; +import { cloneDeep, unset } from 'oak-domain/lib/utils/lodash'; +import { composeServerUrl } from '../utils/domain'; /** * general数据结构要求的后台上下文 */ @@ -38,6 +39,29 @@ export class BackendRuntimeContext extends BRC { } else if (['application', 'system', 'platform'].includes(entity)) { // todo 删除掉config中的敏感返回信息 + const rowDict = d[entity]; + for (const id in rowDict) { + const { config } = rowDict[id]; + if (config) { + // application中可能的保密信息 + unset(config, 'appSecret'); + unset(config, 'server.token'); + unset(config, 'server.mode'); + unset(config, 'server.encodingAESKey'); + unset(config, 'wechat.appSecret'); + // server/platform中可能的保密信息 + if (config.Account) { + for (const k in config.Account) { + config.Account[k]?.forEach((ele) => { + unset(ele, 'securityKey'); + unset(ele, 'secretKey'); + unset(ele, 'webApiKey'); + unset(ele, 'accessKeySecret'); + }); + } + } + } + } } } } @@ -46,43 +70,39 @@ export class BackendRuntimeContext extends BRC { async setTokenValue(tokenValue, userId) { if (tokenValue) { // 前台传递 - const result = await this.select( - 'token', - { - data: { + const result = await this.select('token', { + data: { + id: 1, + ableState: 1, + user: { id: 1, - ableState: 1, - user: { - id: 1, - userState: 1, - isRoot: 1, - }, - userId: 1, - value: 1, - player: { - id: 1, - isRoot: 1, - }, + userState: 1, + isRoot: 1, }, - filter: { - $or: [ - { - value: tokenValue, - }, - { - oldValue: tokenValue, - refreshedAt: { - $gte: Date.now() - 300 * 1000, - }, - }, - ], + userId: 1, + value: 1, + player: { + id: 1, + isRoot: 1, }, }, - { - dontCollect: true, - blockTrigger: true, - } - ); + filter: { + $or: [ + { + value: tokenValue, + }, + { + oldValue: tokenValue, + refreshedAt: { + $gte: Date.now() - 300 * 1000, + }, + }, + ], + }, + }, { + dontCollect: true, + blockTrigger: true, + }); if (result.length === 0) { console.log(`构建BackendRuntimeContext对应tokenValue「${tokenValue}找不到相关的user`); throw new OakTokenExpiredException(); @@ -254,4 +274,16 @@ export class BackendRuntimeContext extends BRC { } throw new OakUnloggedInException('您尚未登录'); } + /** + * 获得当前系统的访问路径,根据application/system/domain之间的关联 + * http://www.xxx.com/oak-api + */ + composeAccessPath() { + const application = this.getApplication(); + const { system } = application; + const { domain$system: domains } = system; + assert(domains && domains.length === 1); + const [domain] = domains; + return composeServerUrl(domain); + } } diff --git a/es/data/i18n.js b/es/data/i18n.js index 4d4fe2680..e1fe9ae3d 100644 --- a/es/data/i18n.js +++ b/es/data/i18n.js @@ -236,6 +236,24 @@ const i18ns = [ "syncWeChat": "同步微信信息" } }, + { + id: "9885467e6b54e456157a7740908e85e0", + namespace: "oak-general-business-c-user-authentication", + language: "zh-CN", + module: "oak-general-business", + position: "src/components/user/authentication", + data: { + "please input name": "请输入姓名", + "please input idNumber": "请输入证件号码", + "please choose idCardType": "请选择证件类型", + "Identity witness profile": "身份证人像面", + "Identity national emblem profile": "身份证国徽面", + "Real name verification passed": "已通过实名验证", + "please upload identity witness profile": "请上传身份证人像面", + "please upload identity national emblem profile": "请上传身份证国徽面", + "commit": "提交认证" + } + }, { id: "34e1363e6dc2a9b3a4e5defc0d570e38", namespace: "oak-general-business-c-user-info", diff --git a/es/entities/User.js b/es/entities/User.js index e0000ef11..d22be8679 100644 --- a/es/entities/User.js +++ b/es/entities/User.js @@ -18,7 +18,7 @@ export const UserActionDef = { }; export const entityDesc = { locales: { - "zh_CN": { + zh_CN: { name: '用户', attr: { name: '姓名', @@ -32,7 +32,7 @@ export const entityDesc = { ref: '指向用户', files: '相关文件', userState: '用户状态', - idState: '身份验证状态', + idState: '认证状态', codes: '微信分享二维码', isRoot: '是否超级用户', addresses: '收货地址', @@ -40,7 +40,7 @@ export const entityDesc = { action: { activate: '激活', accept: '同意', - verify: '验证', + verify: '认证', reject: '拒绝', enable: '启用', disable: '禁用', @@ -55,21 +55,21 @@ export const entityDesc = { merged: '已被合并', }, idState: { - unverified: '未验证', - verifying: '验证中', - verified: '已验证', + unverified: '未认证', + verifying: '认证中', + verified: '已认证', }, gender: { male: '男', female: '女', }, idCardType: { - "ID-Card": '身份证', + 'ID-Card': '身份证', passport: '护照', - "Mainland-passport": '港澳台通行证', + 'Mainland-passport': '港澳台通行证', }, - } - } + }, + }, }, indexes: [ { @@ -89,12 +89,12 @@ export const entityDesc = { }, { name: 'nickname', - } + }, ], config: { type: 'fulltext', parser: 'ngram', - } + }, }, { name: 'index_userState_refId', @@ -104,8 +104,8 @@ export const entityDesc = { }, { name: 'ref', - } - ] + }, + ], }, ], style: { @@ -138,8 +138,8 @@ export const entityDesc = { idCardType: { 'ID-Card': '#E0FFFF', 'Mainland-passport': '#2E8B57', - 'passport': '#2F4F4F', + passport: '#2F4F4F', }, - } - } + }, + }, }; diff --git a/es/features/token.js b/es/features/token.js index 19aab1cb2..227c3560b 100644 --- a/es/features/token.js +++ b/es/features/token.js @@ -1,5 +1,5 @@ import { Feature } from 'oak-frontend-base/es/types/Feature'; -import { OakRowInconsistencyException, OakUnloggedInException, OakNetworkException, OakServerProxyException, } from 'oak-domain/lib/types/Exception'; +import { OakUnloggedInException, OakNetworkException, OakServerProxyException, OakPreConditionUnsetException, } from 'oak-domain/lib/types/Exception'; import { tokenProjection } from '../types/Projection'; import { OakUserInfoLoadingException } from '../types/Exception'; import { LOCAL_STORAGE_KEYS } from '../config/constants'; @@ -206,7 +206,7 @@ export class Token extends Feature { async switchTo(userId) { const currentUserId = this.getUserId(); if (currentUserId === userId) { - throw new OakRowInconsistencyException(undefined, '您已经是当前用户'); + throw new OakPreConditionUnsetException('您已经是当前用户'); } await this.cache.exec('switchTo', { userId, diff --git a/es/oak-app-domain/User/Storage.js b/es/oak-app-domain/User/Storage.js index fbf51fded..854422558 100644 --- a/es/oak-app-domain/User/Storage.js +++ b/es/oak-app-domain/User/Storage.js @@ -72,12 +72,12 @@ export const desc = { }, { name: 'nickname', - } + }, ], config: { type: 'fulltext', parser: 'ngram', - } + }, }, { name: 'index_userState_refId', @@ -87,8 +87,8 @@ export const desc = { }, { name: "refId", - } - ] + }, + ], } ] }; diff --git a/es/oak-app-domain/User/Style.js b/es/oak-app-domain/User/Style.js index c991da09d..105593f53 100644 --- a/es/oak-app-domain/User/Style.js +++ b/es/oak-app-domain/User/Style.js @@ -28,7 +28,7 @@ export const style = { idCardType: { 'ID-Card': '#E0FFFF', 'Mainland-passport': '#2E8B57', - 'passport': '#2F4F4F', + passport: '#2F4F4F', }, - } + }, }; diff --git a/es/oak-app-domain/User/locales/zh_CN.json b/es/oak-app-domain/User/locales/zh_CN.json index 6be6a444f..f0447f0d1 100644 --- a/es/oak-app-domain/User/locales/zh_CN.json +++ b/es/oak-app-domain/User/locales/zh_CN.json @@ -1 +1 @@ -{ "name": "用户", "attr": { "name": "姓名", "nickname": "昵称", "birth": "生日", "password": "密码", "passwordSha1": "sha1加密密码", "gender": "性别", "idCardType": "证件类型", "idNumber": "证件号码", "ref": "指向用户", "files": "相关文件", "userState": "用户状态", "idState": "身份验证状态", "codes": "微信分享二维码", "isRoot": "是否超级用户", "addresses": "收货地址" }, "action": { "activate": "激活", "accept": "同意", "verify": "验证", "reject": "拒绝", "enable": "启用", "disable": "禁用", "mergeTo": "合并", "mergeFrom": "使合并" }, "v": { "userState": { "shadow": "未激活", "normal": "正常", "disabled": "禁用", "merged": "已被合并" }, "idState": { "unverified": "未验证", "verifying": "验证中", "verified": "已验证" }, "gender": { "male": "男", "female": "女" }, "idCardType": { "ID-Card": "身份证", "passport": "护照", "Mainland-passport": "港澳台通行证" } } } +{ "name": "用户", "attr": { "name": "姓名", "nickname": "昵称", "birth": "生日", "password": "密码", "passwordSha1": "sha1加密密码", "gender": "性别", "idCardType": "证件类型", "idNumber": "证件号码", "ref": "指向用户", "files": "相关文件", "userState": "用户状态", "idState": "认证状态", "codes": "微信分享二维码", "isRoot": "是否超级用户", "addresses": "收货地址" }, "action": { "activate": "激活", "accept": "同意", "verify": "认证", "reject": "拒绝", "enable": "启用", "disable": "禁用", "mergeTo": "合并", "mergeFrom": "使合并" }, "v": { "userState": { "shadow": "未激活", "normal": "正常", "disabled": "禁用", "merged": "已被合并" }, "idState": { "unverified": "未认证", "verifying": "认证中", "verified": "已认证" }, "gender": { "male": "男", "female": "女" }, "idCardType": { "ID-Card": "身份证", "passport": "护照", "Mainland-passport": "港澳台通行证" } } } diff --git a/es/triggers/userEntityGrant.js b/es/triggers/userEntityGrant.js index 12eb99608..4a2199881 100644 --- a/es/triggers/userEntityGrant.js +++ b/es/triggers/userEntityGrant.js @@ -150,7 +150,7 @@ const triggers = [ } ); if (result2.length) { - const e = new OakRowInconsistencyException(undefined, '已领取该权限'); + const e = new OakRowInconsistencyException('已领取该权限'); e.addData('userRelation', result2); closeRootMode(); throw e; diff --git a/es/types/Exception.d.ts b/es/types/Exception.d.ts index 073c60a95..144d597c7 100644 --- a/es/types/Exception.d.ts +++ b/es/types/Exception.d.ts @@ -24,6 +24,9 @@ export declare class OakChangeLoginWayException extends OakUserException { constructor(message?: string); } +export declare class OakAuthenticationException extends OakUserException { + constructor(message?: string); +} export declare class OakUserInfoUncompletedException extends OakUserException { constructor(message?: string); } diff --git a/es/types/Exception.js b/es/types/Exception.js index 46b98a099..52742f0ae 100644 --- a/es/types/Exception.js +++ b/es/types/Exception.js @@ -60,9 +60,14 @@ export class OakMobileUnsetException extends OakUserException { super(message || '您需要先登记手机号'); } } +export class OakAuthenticationException extends OakUserException { + constructor(message) { + super(message || '您需要先实名认证'); + } +} export class OakUserInfoUncompletedException extends OakUserException { constructor(message) { - super(message || '您需要先填写完整的用户信息'); + super(message || '您需要先完善用户信息'); } } export class OakUserDisabledException extends OakUserException { @@ -129,6 +134,10 @@ export function makeException(data) { e = new OakMobileUnsetException(message); break; } + case 'OakAuthenticationException': { + e = new OakAuthenticationException(message); + break; + } case 'OakUserInfoUncompletedException': { e = new OakUserInfoUncompletedException(message); break; diff --git a/lib/aspects/token.js b/lib/aspects/token.js index 9fdf83ffe..5886a74dd 100644 --- a/lib/aspects/token.js +++ b/lib/aspects/token.js @@ -1200,7 +1200,7 @@ async function switchTo({ userId }, context) { } const currentUserId = context.getCurrentUserId(); if (currentUserId === userId) { - throw new types_1.OakRowInconsistencyException(undefined, '您已经是当前用户'); + throw new types_1.OakPreConditionUnsetException('您已经是当前用户'); } const token = context.getToken(); await context.operate('token', { @@ -1279,14 +1279,9 @@ async function wakeupParasite(params, context) { }, }, { dontCollect: true }); if (parasite.expired) { - throw new types_1.OakRowInconsistencyException({ - a: 's', - d: { - parasite: { - [id]: (0, lodash_1.pick)(parasite, ['id', 'expired']), - }, - }, - }, '数据已经过期'); + const e = new types_1.OakRowInconsistencyException('数据已经过期'); + e.addData('parasite', [parasite]); + throw e; } if (parasite.user?.userState !== 'shadow') { throw new types_1.OakUserException('此用户已经登录过系统,不允许借用身份'); diff --git a/lib/checkers/parasite.js b/lib/checkers/parasite.js index 27d0eb185..6dcf52bdb 100644 --- a/lib/checkers/parasite.js +++ b/lib/checkers/parasite.js @@ -25,14 +25,9 @@ const checkers = [ const checkUser = (users) => { const [user] = users; if (user.userState !== 'shadow') { - throw new types_1.OakRowInconsistencyException({ - a: 's', - d: { - user: { - [user.id]: user, - }, - }, - }); + const e = new types_1.OakRowInconsistencyException(); + e.addData('user', [user]); + throw e; } }; if (users2 instanceof Promise) { diff --git a/lib/context/BackendRuntimeContext.d.ts b/lib/context/BackendRuntimeContext.d.ts index dbed9893d..f7f6b3f0a 100644 --- a/lib/context/BackendRuntimeContext.d.ts +++ b/lib/context/BackendRuntimeContext.d.ts @@ -30,4 +30,9 @@ export declare abstract class BackendRuntimeContext>; allowUserUpdate(): boolean; + /** + * 获得当前系统的访问路径,根据application/system/domain之间的关联 + * http://www.xxx.com/oak-api + */ + composeAccessPath(): string; } diff --git a/lib/context/BackendRuntimeContext.js b/lib/context/BackendRuntimeContext.js index 26b9cdd0d..c874798ee 100644 --- a/lib/context/BackendRuntimeContext.js +++ b/lib/context/BackendRuntimeContext.js @@ -10,6 +10,7 @@ const Projection_1 = require("../types/Projection"); const wechatQrCode_1 = require("../aspects/wechatQrCode"); const oak_frontend_base_1 = require("oak-frontend-base"); const lodash_1 = require("oak-domain/lib/utils/lodash"); +const domain_1 = require("../utils/domain"); /** * general数据结构要求的后台上下文 */ @@ -41,6 +42,29 @@ class BackendRuntimeContext extends oak_frontend_base_1.BackendRuntimeContext { } else if (['application', 'system', 'platform'].includes(entity)) { // todo 删除掉config中的敏感返回信息 + const rowDict = d[entity]; + for (const id in rowDict) { + const { config } = rowDict[id]; + if (config) { + // application中可能的保密信息 + (0, lodash_1.unset)(config, 'appSecret'); + (0, lodash_1.unset)(config, 'server.token'); + (0, lodash_1.unset)(config, 'server.mode'); + (0, lodash_1.unset)(config, 'server.encodingAESKey'); + (0, lodash_1.unset)(config, 'wechat.appSecret'); + // server/platform中可能的保密信息 + if (config.Account) { + for (const k in config.Account) { + config.Account[k]?.forEach((ele) => { + (0, lodash_1.unset)(ele, 'securityKey'); + (0, lodash_1.unset)(ele, 'secretKey'); + (0, lodash_1.unset)(ele, 'webApiKey'); + (0, lodash_1.unset)(ele, 'accessKeySecret'); + }); + } + } + } + } } } } @@ -253,5 +277,17 @@ class BackendRuntimeContext extends oak_frontend_base_1.BackendRuntimeContext { } throw new Exception_2.OakUnloggedInException('您尚未登录'); } + /** + * 获得当前系统的访问路径,根据application/system/domain之间的关联 + * http://www.xxx.com/oak-api + */ + composeAccessPath() { + const application = this.getApplication(); + const { system } = application; + const { domain$system: domains } = system; + (0, assert_1.assert)(domains && domains.length === 1); + const [domain] = domains; + return (0, domain_1.composeServerUrl)(domain); + } } exports.BackendRuntimeContext = BackendRuntimeContext; diff --git a/lib/data/i18n.js b/lib/data/i18n.js index b51d52517..71b2bd333 100644 --- a/lib/data/i18n.js +++ b/lib/data/i18n.js @@ -238,6 +238,24 @@ const i18ns = [ "syncWeChat": "同步微信信息" } }, + { + id: "9885467e6b54e456157a7740908e85e0", + namespace: "oak-general-business-c-user-authentication", + language: "zh-CN", + module: "oak-general-business", + position: "src/components/user/authentication", + data: { + "please input name": "请输入姓名", + "please input idNumber": "请输入证件号码", + "please choose idCardType": "请选择证件类型", + "Identity witness profile": "身份证人像面", + "Identity national emblem profile": "身份证国徽面", + "Real name verification passed": "已通过实名验证", + "please upload identity witness profile": "请上传身份证人像面", + "please upload identity national emblem profile": "请上传身份证国徽面", + "commit": "提交认证" + } + }, { id: "34e1363e6dc2a9b3a4e5defc0d570e38", namespace: "oak-general-business-c-user-info", diff --git a/lib/entities/User.js b/lib/entities/User.js index 012eced11..8bfdff08d 100644 --- a/lib/entities/User.js +++ b/lib/entities/User.js @@ -21,7 +21,7 @@ exports.UserActionDef = { }; exports.entityDesc = { locales: { - "zh_CN": { + zh_CN: { name: '用户', attr: { name: '姓名', @@ -35,7 +35,7 @@ exports.entityDesc = { ref: '指向用户', files: '相关文件', userState: '用户状态', - idState: '身份验证状态', + idState: '认证状态', codes: '微信分享二维码', isRoot: '是否超级用户', addresses: '收货地址', @@ -43,7 +43,7 @@ exports.entityDesc = { action: { activate: '激活', accept: '同意', - verify: '验证', + verify: '认证', reject: '拒绝', enable: '启用', disable: '禁用', @@ -58,21 +58,21 @@ exports.entityDesc = { merged: '已被合并', }, idState: { - unverified: '未验证', - verifying: '验证中', - verified: '已验证', + unverified: '未认证', + verifying: '认证中', + verified: '已认证', }, gender: { male: '男', female: '女', }, idCardType: { - "ID-Card": '身份证', + 'ID-Card': '身份证', passport: '护照', - "Mainland-passport": '港澳台通行证', + 'Mainland-passport': '港澳台通行证', }, - } - } + }, + }, }, indexes: [ { @@ -92,12 +92,12 @@ exports.entityDesc = { }, { name: 'nickname', - } + }, ], config: { type: 'fulltext', parser: 'ngram', - } + }, }, { name: 'index_userState_refId', @@ -107,8 +107,8 @@ exports.entityDesc = { }, { name: 'ref', - } - ] + }, + ], }, ], style: { @@ -141,8 +141,8 @@ exports.entityDesc = { idCardType: { 'ID-Card': '#E0FFFF', 'Mainland-passport': '#2E8B57', - 'passport': '#2F4F4F', + passport: '#2F4F4F', }, - } - } + }, + }, }; diff --git a/lib/features/token.js b/lib/features/token.js index c23b71383..c3a4e6a8f 100644 --- a/lib/features/token.js +++ b/lib/features/token.js @@ -209,7 +209,7 @@ class Token extends Feature_1.Feature { async switchTo(userId) { const currentUserId = this.getUserId(); if (currentUserId === userId) { - throw new Exception_1.OakRowInconsistencyException(undefined, '您已经是当前用户'); + throw new Exception_1.OakPreConditionUnsetException('您已经是当前用户'); } await this.cache.exec('switchTo', { userId, diff --git a/lib/oak-app-domain/User/Storage.js b/lib/oak-app-domain/User/Storage.js index 285e2bcd8..d98b508a4 100644 --- a/lib/oak-app-domain/User/Storage.js +++ b/lib/oak-app-domain/User/Storage.js @@ -75,12 +75,12 @@ exports.desc = { }, { name: 'nickname', - } + }, ], config: { type: 'fulltext', parser: 'ngram', - } + }, }, { name: 'index_userState_refId', @@ -90,8 +90,8 @@ exports.desc = { }, { name: "refId", - } - ] + }, + ], } ] }; diff --git a/lib/oak-app-domain/User/Style.js b/lib/oak-app-domain/User/Style.js index d0f422589..58f95a4ed 100644 --- a/lib/oak-app-domain/User/Style.js +++ b/lib/oak-app-domain/User/Style.js @@ -31,7 +31,7 @@ exports.style = { idCardType: { 'ID-Card': '#E0FFFF', 'Mainland-passport': '#2E8B57', - 'passport': '#2F4F4F', + passport: '#2F4F4F', }, - } + }, }; diff --git a/lib/oak-app-domain/User/locales/zh_CN.json b/lib/oak-app-domain/User/locales/zh_CN.json index 6be6a444f..f0447f0d1 100644 --- a/lib/oak-app-domain/User/locales/zh_CN.json +++ b/lib/oak-app-domain/User/locales/zh_CN.json @@ -1 +1 @@ -{ "name": "用户", "attr": { "name": "姓名", "nickname": "昵称", "birth": "生日", "password": "密码", "passwordSha1": "sha1加密密码", "gender": "性别", "idCardType": "证件类型", "idNumber": "证件号码", "ref": "指向用户", "files": "相关文件", "userState": "用户状态", "idState": "身份验证状态", "codes": "微信分享二维码", "isRoot": "是否超级用户", "addresses": "收货地址" }, "action": { "activate": "激活", "accept": "同意", "verify": "验证", "reject": "拒绝", "enable": "启用", "disable": "禁用", "mergeTo": "合并", "mergeFrom": "使合并" }, "v": { "userState": { "shadow": "未激活", "normal": "正常", "disabled": "禁用", "merged": "已被合并" }, "idState": { "unverified": "未验证", "verifying": "验证中", "verified": "已验证" }, "gender": { "male": "男", "female": "女" }, "idCardType": { "ID-Card": "身份证", "passport": "护照", "Mainland-passport": "港澳台通行证" } } } +{ "name": "用户", "attr": { "name": "姓名", "nickname": "昵称", "birth": "生日", "password": "密码", "passwordSha1": "sha1加密密码", "gender": "性别", "idCardType": "证件类型", "idNumber": "证件号码", "ref": "指向用户", "files": "相关文件", "userState": "用户状态", "idState": "认证状态", "codes": "微信分享二维码", "isRoot": "是否超级用户", "addresses": "收货地址" }, "action": { "activate": "激活", "accept": "同意", "verify": "认证", "reject": "拒绝", "enable": "启用", "disable": "禁用", "mergeTo": "合并", "mergeFrom": "使合并" }, "v": { "userState": { "shadow": "未激活", "normal": "正常", "disabled": "禁用", "merged": "已被合并" }, "idState": { "unverified": "未认证", "verifying": "认证中", "verified": "已认证" }, "gender": { "male": "男", "female": "女" }, "idCardType": { "ID-Card": "身份证", "passport": "护照", "Mainland-passport": "港澳台通行证" } } } diff --git a/lib/triggers/userEntityGrant.js b/lib/triggers/userEntityGrant.js index a8b6c61e2..202b06fb8 100644 --- a/lib/triggers/userEntityGrant.js +++ b/lib/triggers/userEntityGrant.js @@ -152,7 +152,7 @@ const triggers = [ } ); if (result2.length) { - const e = new OakRowInconsistencyException(undefined, '已领取该权限'); + const e = new OakRowInconsistencyException('已领取该权限'); e.addData('userRelation', result2); closeRootMode(); throw e; diff --git a/lib/types/Exception.d.ts b/lib/types/Exception.d.ts index 073c60a95..144d597c7 100644 --- a/lib/types/Exception.d.ts +++ b/lib/types/Exception.d.ts @@ -24,6 +24,9 @@ export declare class OakChangeLoginWayException extends OakUserException { constructor(message?: string); } +export declare class OakAuthenticationException extends OakUserException { + constructor(message?: string); +} export declare class OakUserInfoUncompletedException extends OakUserException { constructor(message?: string); } diff --git a/lib/types/Exception.js b/lib/types/Exception.js index 434503523..7afab9095 100644 --- a/lib/types/Exception.js +++ b/lib/types/Exception.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeException = exports.OakUploadException = exports.OakApplicationLoadingException = exports.OakUserInfoLoadingException = exports.OakMpHaveToSubscribeMessage = exports.OakTokenExpiredException = exports.OakUserDisabledException = exports.OakUserInfoUncompletedException = exports.OakMobileUnsetException = exports.OakChangeLoginWayException = exports.OakDistinguishUserException = exports.OakNotEnoughMoneyException = void 0; +exports.makeException = exports.OakUploadException = exports.OakApplicationLoadingException = exports.OakUserInfoLoadingException = exports.OakMpHaveToSubscribeMessage = exports.OakTokenExpiredException = exports.OakUserDisabledException = exports.OakUserInfoUncompletedException = exports.OakAuthenticationException = exports.OakMobileUnsetException = exports.OakChangeLoginWayException = exports.OakDistinguishUserException = exports.OakNotEnoughMoneyException = void 0; const types_1 = require("oak-domain/lib/types"); class OakNotEnoughMoneyException extends types_1.OakUserException { constructor(message) { @@ -67,9 +67,15 @@ class OakMobileUnsetException extends types_1.OakUserException { } } exports.OakMobileUnsetException = OakMobileUnsetException; +class OakAuthenticationException extends types_1.OakUserException { + constructor(message) { + super(message || '您需要先实名认证'); + } +} +exports.OakAuthenticationException = OakAuthenticationException; class OakUserInfoUncompletedException extends types_1.OakUserException { constructor(message) { - super(message || '您需要先填写完整的用户信息'); + super(message || '您需要先完善用户信息'); } } exports.OakUserInfoUncompletedException = OakUserInfoUncompletedException; @@ -143,6 +149,10 @@ function makeException(data) { e = new OakMobileUnsetException(message); break; } + case 'OakAuthenticationException': { + e = new OakAuthenticationException(message); + break; + } case 'OakUserInfoUncompletedException': { e = new OakUserInfoUncompletedException(message); break; diff --git a/src/checkers/parasite.ts b/src/checkers/parasite.ts index c48c7f6dd..8e0b65ec3 100644 --- a/src/checkers/parasite.ts +++ b/src/checkers/parasite.ts @@ -33,14 +33,9 @@ const checkers: Checker>[] = [ ) => { const [user] = users; if (user.userState !== 'shadow') { - throw new OakRowInconsistencyException({ - a: 's', - d: { - user: { - [user.id!]: user, - }, - }, - }); + const e = new OakRowInconsistencyException(); + e.addData('user', [user]); + throw e; } }; if (users2 instanceof Promise) { diff --git a/src/components/session/list/index.ts b/src/components/session/list/index.ts index a96e9f2e8..3aa93189f 100644 --- a/src/components/session/list/index.ts +++ b/src/components/session/list/index.ts @@ -126,11 +126,11 @@ export default OakComponent({ if (entityFilter) { assert (entityFilterSubStr); - this.subDataEvents([entityFilterSubStr]); + this.subDataEvents([entityFilterSubStr], 'ogb-c-session-list'); } else { const userId = this.features.token.getUserId(); - this.subDataEvents([`${DATA_SUBSCRIBER_KEYS.sessionList}-u-${userId}`]); + this.subDataEvents([`${DATA_SUBSCRIBER_KEYS.sessionList}-u-${userId}`], 'ogb-c-session-list'); } }, detached() { @@ -138,11 +138,11 @@ export default OakComponent({ if (entityFilter) { assert (entityFilterSubStr); - this.unsubDataEvents([entityFilterSubStr]); + this.unsubDataEvents([entityFilterSubStr], 'ogb-c-session-list'); } else { const userId = this.features.token.getUserId(); - this.unsubDataEvents([`${DATA_SUBSCRIBER_KEYS.sessionList}-u-${userId}`]); + this.unsubDataEvents([`${DATA_SUBSCRIBER_KEYS.sessionList}-u-${userId}`], 'ogb-c-session-list'); } }, }, diff --git a/src/components/sessionMessage/list/index.ts b/src/components/sessionMessage/list/index.ts index 5aefb1210..cd158a4f8 100644 --- a/src/components/sessionMessage/list/index.ts +++ b/src/components/sessionMessage/list/index.ts @@ -52,15 +52,15 @@ export default OakComponent({ async ready() { const { sessionId } = this.props; - this.subDataEvents([`${DATA_SUBSCRIBER_KEYS.sessionMessageList}-${sessionId}`]); + this.subDataEvents([`${DATA_SUBSCRIBER_KEYS.sessionMessageList}-${sessionId}`], 'ogb-c-sessionMessage-list'); this.createItem(); this.getSessionInfo(); }, detached() { const { sessionId } = this.props; this.unsubDataEvents([ - `${DATA_SUBSCRIBER_KEYS.sessionMessageList}-${sessionId}`, - ]); + `${DATA_SUBSCRIBER_KEYS.sessionMessageList}-${sessionId}` + ], 'ogb-c-sessionMessage-list'); }, }, listeners: { diff --git a/src/components/user/authentication/idCard/index.ts b/src/components/user/authentication/idCard/index.ts index 5c55e8b1d..1b40a992f 100644 --- a/src/components/user/authentication/idCard/index.ts +++ b/src/components/user/authentication/idCard/index.ts @@ -58,7 +58,8 @@ export default OakComponent({ origin: 'qiniu', idCardType: '', entityId: '', - entity: 'user' + entity: 'user', + autoUpload: false }, methods: { async onPickMp(e: WechatMiniprogram.Touch) { diff --git a/src/context/BackendRuntimeContext.ts b/src/context/BackendRuntimeContext.ts index ffe4294d8..8ed9d7ba4 100644 --- a/src/context/BackendRuntimeContext.ts +++ b/src/context/BackendRuntimeContext.ts @@ -18,6 +18,7 @@ import { applicationProjection } from '../types/Projection'; import { getMpUnlimitWxaCode } from '../aspects/wechatQrCode'; import { BackendRuntimeContext as BRC } from 'oak-frontend-base'; import { cloneDeep, unset } from 'oak-domain/lib/utils/lodash'; +import { composeServerUrl } from '../utils/domain'; /** * general数据结构要求的后台上下文 */ @@ -72,10 +73,14 @@ export abstract class BackendRuntimeContext { + unset(ele, 'securityKey'); + unset(ele, 'secretKey'); + unset(ele, 'webApiKey'); + unset(ele, 'accessKeySecret'); + } + ); } } } @@ -329,4 +334,18 @@ export abstract class BackendRuntimeContext } }; + export class OakDistinguishUserException extends OakUserException { userId: string; usingPassword: boolean;