From a50d4a1435e9dbab42ef1d0f3be597b01806245b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E6=9C=9D=E4=BC=9F?= <2211960668@qq.com> Date: Fri, 26 May 2023 16:23:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E5=85=88=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BE=AE=E4=BF=A1=E8=B4=A6=E5=8F=B7=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/aspects/token.js | 4 -- lib/entities/Application.d.ts | 6 +-- .../Application/Schema.d.ts | 6 +-- lib/pages/user/info/web.pc.js | 4 +- src/aspects/token.ts | 4 -- src/pages/user/info/web.pc.tsx | 44 ++++++++++--------- 6 files changed, 31 insertions(+), 37 deletions(-) diff --git a/lib/aspects/token.js b/lib/aspects/token.js index 777ef81f1..455e4a83a 100644 --- a/lib/aspects/token.js +++ b/lib/aspects/token.js @@ -188,12 +188,10 @@ createData, user) { (0, assert_1.assert)(schema.hasOwnProperty(entity), "".concat(entity, "\u5FC5\u987B\u662F\u6709\u6548\u7684\u5BF9\u8C61\u540D ")); (0, assert_1.assert)(schema.token.attributes.entity.ref.includes(entity), "".concat(entity, "\u5FC5\u987B\u662Ftoken\u7684\u6709\u6548\u5173\u8054\u5BF9\u8C61")); (0, assert_1.assert)(schema[entity].attributes.hasOwnProperty('userId') && schema[entity].attributes.userId.ref === 'user', "".concat(entity, "\u5FC5\u987B\u6709\u6307\u5411user\u7684userId\u5C5E\u6027")); - console.log('-------------currentToken-------------', currentToken); if (!currentToken) return [3 /*break*/, 20]; (0, assert_1.assert)(currentToken.id); (0, assert_1.assert)(currentToken.userId); if (!user) return [3 /*break*/, 12]; - console.log('-------ifcurrentTokenifuser----------------'); userState = user.userState; _a = userState; switch (_a) { @@ -253,7 +251,6 @@ createData, user) { _23.label = 11; case 11: return [3 /*break*/, 19]; case 12: - console.log('-------ifcurrentToken-else----------------'); // 没用户,指向当前用户 (0, assert_1.assert)(createData && !entityId); if (!createData) return [3 /*break*/, 15]; @@ -291,7 +288,6 @@ createData, user) { case 18: return [2 /*return*/, currentToken.id]; case 19: return [3 /*break*/, 50]; case 20: - console.log('------------elseToken------------'); if (!entityId) return [3 /*break*/, 22]; application = context.getApplication(); return [4 /*yield*/, context.select('token', { diff --git a/lib/entities/Application.d.ts b/lib/entities/Application.d.ts index a168a2486..ab5cb5c85 100644 --- a/lib/entities/Application.d.ts +++ b/lib/entities/Application.d.ts @@ -17,7 +17,7 @@ export declare type WechatMpConfig = { mode: 'clear' | 'compatible' | 'safe'; dataFormat: 'json' | 'xml'; }; - passport: Passport[]; + passport?: Passport[]; }; export declare type WebConfig = { type: 'web'; @@ -27,7 +27,7 @@ export declare type WebConfig = { domain?: string; enable?: boolean; }; - passport: Passport[]; + passport?: Passport[]; }; export declare type WechatPublicTemplateMsgsConfig = Record; export declare type WechatPublicConfig = { @@ -48,7 +48,7 @@ export declare type WechatPublicConfig = { appId: string; originalId: string; }; - passport: Passport[]; + passport?: Passport[]; }; export interface Schema extends EntityShape { name: String<32>; diff --git a/lib/general-app-domain/Application/Schema.d.ts b/lib/general-app-domain/Application/Schema.d.ts index 390a6efd3..006d65691 100644 --- a/lib/general-app-domain/Application/Schema.d.ts +++ b/lib/general-app-domain/Application/Schema.d.ts @@ -27,7 +27,7 @@ export declare type WechatMpConfig = { mode: 'clear' | 'compatible' | 'safe'; dataFormat: 'json' | 'xml'; }; - passport: Passport[]; + passport?: Passport[]; }; export declare type WebConfig = { type: 'web'; @@ -37,7 +37,7 @@ export declare type WebConfig = { domain?: string; enable?: boolean; }; - passport: Passport[]; + passport?: Passport[]; }; export declare type WechatPublicTemplateMsgsConfig = Record; export declare type WechatPublicConfig = { @@ -58,7 +58,7 @@ export declare type WechatPublicConfig = { appId: string; originalId: string; }; - passport: Passport[]; + passport?: Passport[]; }; export declare type OpSchema = EntityShape & { name: String<32>; diff --git a/lib/pages/user/info/web.pc.js b/lib/pages/user/info/web.pc.js index 8df679995..633e039bd 100644 --- a/lib/pages/user/info/web.pc.js +++ b/lib/pages/user/info/web.pc.js @@ -60,9 +60,9 @@ function Render(props) { return; } setOpen(true); - } }, { children: mobile ? t('manage') : t('bind') }))] }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u5FAE\u4FE1\u5E10\u53F7" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: wechatUser ? ((0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Typography, { children: wechatUser.nickname }), (0, jsx_runtime_1.jsx)(bindingList_1.default, { oakPath: oakFullpath ? "".concat(oakFullpath, ".wechatUser$user") : undefined })] })) : ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ size: "small", onClick: function () { + } }, { children: mobile ? t('manage') : t('bind') }))] }) }) })), process.env.NODE_ENV === 'development' && ((0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u5FAE\u4FE1\u5E10\u53F7" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: wechatUser ? ((0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Typography, { children: wechatUser.nickname }), (0, jsx_runtime_1.jsx)(bindingList_1.default, { oakPath: oakFullpath ? "".concat(oakFullpath, ".wechatUser$user") : undefined })] })) : ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ size: "small", onClick: function () { setOpen2(true); - } }, { children: "\u7ED1\u5B9A" }))) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { + } }, { children: "\u7ED1\u5B9A" }))) }) }))), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { xs: { offset: 4 }, md: { offset: 6 }, } }, { children: (0, jsx_runtime_1.jsx)(antd_1.Space, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ disabled: oakExecuting || !oakDirty, type: "primary", onClick: function () { diff --git a/src/aspects/token.ts b/src/aspects/token.ts index a3da6f2d0..a295e7ddc 100644 --- a/src/aspects/token.ts +++ b/src/aspects/token.ts @@ -155,12 +155,10 @@ async function setUpTokenAndUser - {/* - <> - {wechatUser ? ( - - {wechatUser.nickname} - - - ) : ( - - )} - - */} + {process.env.NODE_ENV === 'development' && ( + + <> + {wechatUser ? ( + + {wechatUser.nickname} + + + ) : ( + + )} + + + )}