From 7ef242ec49383e6690a0c4900b32b9a76f1e39a6 Mon Sep 17 00:00:00 2001 From: "Xc@centOs" Date: Mon, 30 Jan 2023 10:55:07 +0800 Subject: [PATCH] auth/mobile --- lib/aspects/token.js | 203 +++++++++--------- lib/auth/index.d.ts | 4 + lib/auth/index.js | 8 + lib/auth/mobile.d.ts | 4 + lib/auth/mobile.js | 11 + lib/components/common/empty/empty.d.ts | 1 - lib/components/common/empty/simple.d.ts | 1 - lib/components/config/application/web.pc.d.ts | 1 - .../config/application/web/index.d.ts | 1 - .../config/application/wechatMp/index.d.ts | 1 - .../application/wechatPublic/index.d.ts | 1 - lib/components/config/style/index.d.ts | 1 - .../config/upsert/account/index.d.ts | 1 - lib/components/config/upsert/cos/index.d.ts | 1 - lib/components/config/upsert/live/index.d.ts | 1 - lib/components/config/upsert/map/index.d.ts | 1 - lib/components/config/upsert/sms/index.d.ts | 1 - lib/components/config/upsert/web.pc.d.ts | 1 - lib/components/entityActionBtn/web.d.ts | 1 - lib/components/extraFile/avatar/web.d.ts | 1 - lib/components/extraFile/display/web.d.ts | 1 - lib/components/extraFile/gallery/web.d.ts | 1 - lib/components/func/actionPanel/web.d.ts | 1 - lib/components/func/debugPanel/web.d.ts | 1 - lib/components/icon-font-awesome/web.d.ts | 1 - lib/components/message/cell/web.d.ts | 1 - lib/components/message/cellButton/web.d.ts | 1 - lib/components/message/web.d.ts | 1 - lib/components/my/avatar/web.d.ts | 1 - lib/components/my/info/web.d.ts | 1 - lib/components/my/info/web.pc.d.ts | 1 - .../userEntityGrant/cellButton/web.d.ts | 1 - lib/context/BackendRuntimeContext.d.ts | 1 + lib/context/BackendRuntimeContext.js | 137 ++++++------ lib/pages/address/list/web.d.ts | 1 - lib/pages/address/upsert/web.d.ts | 1 - .../application/config/upsert/web.pc.d.ts | 1 - lib/pages/application/detail/web.d.ts | 1 - lib/pages/application/list/web.pc.d.ts | 1 - lib/pages/application/upsert/web.pc.d.ts | 1 - lib/pages/article/detail/web.d.ts | 1 - lib/pages/article/list/web.d.ts | 1 - lib/pages/article/preview/web.d.ts | 1 - lib/pages/article/upsert/web.d.ts | 1 - lib/pages/domain/detail/web.d.ts | 1 - lib/pages/domain/list/web.pc.d.ts | 1 - lib/pages/domain/upsert/web.pc.d.ts | 1 - lib/pages/icon/web.d.ts | 1 - lib/pages/login/web.d.ts | 1 - lib/pages/message/detail/web.d.ts | 1 - lib/pages/message/detail/web.pc.d.ts | 1 - lib/pages/message/drawerList/web.d.ts | 1 - lib/pages/message/list/web.d.ts | 1 - lib/pages/message/list/web.pc.d.ts | 1 - lib/pages/mobile/login/web.d.ts | 1 - lib/pages/mobile/me/web.d.ts | 1 - lib/pages/personal/web.d.ts | 1 - lib/pages/personal/web.pc.d.ts | 1 - lib/pages/pickers/area/web.d.ts | 1 - lib/pages/platform/config/upsert/web.pc.d.ts | 1 - lib/pages/platform/detail/web.d.ts | 1 - lib/pages/platform/list/web.pc.d.ts | 1 - lib/pages/platform/upsert/web.pc.d.ts | 1 - lib/pages/setting/web.d.ts | 1 - lib/pages/setting/web.pc.d.ts | 1 - .../subscription/config/upsert/web.pc.d.ts | 1 - lib/pages/subscription/detail/web.d.ts | 1 - lib/pages/subscription/list/web.pc.d.ts | 1 - lib/pages/subscription/upsert/web.pc.d.ts | 1 - lib/pages/system/config/upsert/web.pc.d.ts | 1 - lib/pages/system/detail/web.d.ts | 1 - lib/pages/system/list/web.pc.d.ts | 1 - lib/pages/system/upsert/web.pc.d.ts | 1 - lib/pages/token/me/web.d.ts | 1 - lib/pages/user/info/web.d.ts | 1 - lib/pages/user/info/web.pc.d.ts | 1 - lib/pages/user/manage/detail/web.d.ts | 1 - lib/pages/user/manage/upsert/web.d.ts | 1 - lib/pages/user/manage/web.d.ts | 1 - lib/pages/user/manage/web.pc.d.ts | 1 - lib/pages/user/search/web.d.ts | 1 - lib/pages/userEntityGrant/confirm/web.d.ts | 1 - lib/pages/userEntityGrant/detail/web.d.ts | 1 - lib/pages/userEntityGrant/detail/web.pc.d.ts | 1 - lib/pages/userEntityGrant/grant/web.d.ts | 1 - lib/pages/userEntityGrant/list/web.d.ts | 1 - lib/pages/userRelation/list/index.js | 2 +- lib/pages/userRelation/list/web.d.ts | 1 - lib/pages/userRelation/list/web.pc.d.ts | 1 - lib/pages/userRelation/manage/web.d.ts | 1 - lib/pages/userRelation/onEntity/web.d.ts | 1 - .../userRelation/upsert/byMobile/web.pc.d.ts | 1 - .../userRelation/upsert/byUser/web.pc.d.ts | 1 - .../upsert/byUserEntityGrant/web.d.ts | 1 - .../upsert/byUserEntityGrant/web.pc.d.ts | 1 - lib/pages/userRelation/upsert/onUser/index.js | 2 +- .../upsert/onUser/userRelation/web.pc.d.ts | 1 - lib/pages/userRelation/upsert/onUser/web.d.ts | 1 - .../userRelation/upsert/onUser/web.pc.d.ts | 1 - .../userRelation/upsert/onUser/web.pc.js | 4 +- lib/pages/userRelation/upsert/web.d.ts | 1 - lib/pages/userRelation/upsert/web.pc.d.ts | 1 - lib/pages/wechatQrCode/scan/web.d.ts | 1 - lib/pages/wechatUser/login/index.js | 93 ++++---- lib/pages/wechatUser/login/web.d.ts | 1 - src/aspects/token.ts | 26 ++- src/auth/index.ts | 9 + src/auth/mobile.ts | 14 ++ src/context/BackendRuntimeContext.ts | 133 ++++++------ 109 files changed, 359 insertions(+), 386 deletions(-) create mode 100644 lib/auth/index.d.ts create mode 100644 lib/auth/index.js create mode 100644 lib/auth/mobile.d.ts create mode 100644 lib/auth/mobile.js create mode 100644 src/auth/index.ts create mode 100644 src/auth/mobile.ts diff --git a/lib/aspects/token.js b/lib/aspects/token.js index eca3e73dd..98f4a8f82 100644 --- a/lib/aspects/token.js +++ b/lib/aspects/token.js @@ -96,10 +96,10 @@ function tryMakeChangeLoginWay(userId, context) { function setupMobile(mobile, env, context) { var _a; return tslib_1.__awaiter(this, void 0, void 0, function () { - var currentToken, applicationId, systemId, result2, _b, mobileRow, userId, tokenData, user, userState, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, mobileData, _o, _p, _q, userData, _r, _s, _t, tokenData, _u, _v, _w; - var _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10; - return tslib_1.__generator(this, function (_11) { - switch (_11.label) { + var currentToken, applicationId, systemId, result2, _b, mobileRow, userId, tokenData, user, userState, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, mobileData, _o, _p, _q, userData, _r, _s, _t, mobileData, tokenData, _u, _v, _w, _x, _y, _z; + var _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13; + return tslib_1.__generator(this, function (_14) { + switch (_14.label) { case 0: currentToken = context.getToken(true); applicationId = context.getApplicationId(); @@ -134,7 +134,7 @@ function setupMobile(mobile, env, context) { } }, { dontCollect: true })]; case 1: - result2 = _11.sent(); + result2 = _14.sent(); if (!(result2.length > 0)) return [3 /*break*/, 19]; // 此手机号已经存在 (0, assert_1.assert)(result2.length === 1); @@ -145,19 +145,19 @@ function setupMobile(mobile, env, context) { case 2: userId = mobileRow.userId; return [4 /*yield*/, makeDistinguishException(userId, context)]; - case 3: throw _11.sent(); + case 3: throw _14.sent(); case 4: return [3 /*break*/, 18]; case 5: - _x = {}; + _0 = {}; return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; case 6: - tokenData = (_x.id = _11.sent(), - _x.applicationId = applicationId, - _x.playerId = mobileRow.userId, - _x.env = env, - _x.entity = 'mobile', - _x.entityId = mobileRow.id, - _x); + tokenData = (_0.id = _14.sent(), + _0.applicationId = applicationId, + _0.playerId = mobileRow.userId, + _0.env = env, + _0.entity = 'mobile', + _0.entityId = mobileRow.id, + _0); user = mobileRow.user; userState = user.userState; _c = userState; @@ -170,21 +170,21 @@ function setupMobile(mobile, env, context) { { throw new Exception_1.OakUserDisabledException(); } - _11.label = 8; + _14.label = 8; case 8: _e = (_d = Object).assign; _f = [tokenData]; - _y = { + _1 = { userId: mobileRow.userId }; - _z = {}; + _2 = {}; return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; case 9: - _e.apply(_d, _f.concat([(_y.user = (_z.id = _11.sent(), - _z.action = 'activate', - _z.data = {}, - _z), - _y)])); + _e.apply(_d, _f.concat([(_1.user = (_2.id = _14.sent(), + _2.action = 'activate', + _2.data = {}, + _2), + _1)])); return [3 /*break*/, 11]; case 10: { @@ -193,112 +193,121 @@ function setupMobile(mobile, env, context) { userId: mobileRow.userId, }); } - _11.label = 11; + _14.label = 11; case 11: _h = (_g = context).operate; _j = ['token']; - _0 = {}; + _3 = {}; return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; - case 12: return [4 /*yield*/, _h.apply(_g, _j.concat([(_0.id = _11.sent(), - _0.data = tokenData, - _0.action = 'create', - _0), { + case 12: return [4 /*yield*/, _h.apply(_g, _j.concat([(_3.id = _14.sent(), + _3.data = tokenData, + _3.action = 'create', + _3), { dontCollect: true, }]))]; case 13: - _11.sent(); + _14.sent(); if (!(((_a = user === null || user === void 0 ? void 0 : user.userSystem$user) === null || _a === void 0 ? void 0 : _a.length) == 0)) return [3 /*break*/, 17]; _l = (_k = context).operate; _m = ['userSystem']; - _1 = {}; + _4 = {}; return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; case 14: - _1.id = _11.sent(), - _1.action = 'create'; - _2 = {}; + _4.id = _14.sent(), + _4.action = 'create'; + _5 = {}; return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; - case 15: return [4 /*yield*/, _l.apply(_k, _m.concat([(_1.data = (_2.id = _11.sent(), - _2.userId = user.id, - _2.systemId = systemId, - _2), - _1), { + case 15: return [4 /*yield*/, _l.apply(_k, _m.concat([(_4.data = (_5.id = _14.sent(), + _5.userId = user.id, + _5.systemId = systemId, + _5), + _4), { dontCollect: true, }]))]; case 16: - _11.sent(); - _11.label = 17; + _14.sent(); + _14.label = 17; case 17: return [2 /*return*/, tokenData.id]; - case 18: return [3 /*break*/, 32]; + case 18: return [3 /*break*/, 34]; case 19: if (!currentToken) return [3 /*break*/, 23]; - _3 = {}; - return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; - case 20: - mobileData = (_3.id = _11.sent(), - _3.mobile = mobile, - _3.userId = currentToken.userId, - _3); - _p = (_o = context).operate; - _q = ['mobile']; - _4 = {}; - return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; - case 21: return [4 /*yield*/, _p.apply(_o, _q.concat([(_4.id = _11.sent(), - _4.action = 'create', - _4.data = mobileData, - _4), {}]))]; - case 22: - _11.sent(); - return [2 /*return*/, currentToken.id]; - case 23: - _5 = {}; - return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; - case 24: - userData = (_5.id = _11.sent(), - _5.userState = 'normal', - _5); - _s = (_r = context).operate; - _t = ['user']; _6 = {}; return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; - case 25: return [4 /*yield*/, _s.apply(_r, _t.concat([(_6.id = _11.sent(), - _6.action = 'create', - _6.data = userData, - _6), {}]))]; - case 26: - _11.sent(); + case 20: + mobileData = (_6.id = _14.sent(), + _6.mobile = mobile, + _6.userId = currentToken.userId, + _6); + _p = (_o = context).operate; + _q = ['mobile']; _7 = {}; return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; - case 27: - _7.id = _11.sent(), - _7.userId = userData.id, - _7.playerId = userData.id, - _7.env = env; + case 21: return [4 /*yield*/, _p.apply(_o, _q.concat([(_7.id = _14.sent(), + _7.action = 'create', + _7.data = mobileData, + _7), {}]))]; + case 22: + _14.sent(); + return [2 /*return*/, currentToken.id]; + case 23: _8 = {}; return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; - case 28: - _8.id = _11.sent(), - _8.action = 'create'; + case 24: + userData = (_8.id = _14.sent(), + _8.userState = 'normal', + _8); + _s = (_r = context).operate; + _t = ['user']; _9 = {}; return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; - case 29: - tokenData = (_7.mobile = (_8.data = (_9.id = _11.sent(), - _9.mobile = mobile, - _9.userId = userData.id, - _9), - _8), - _7); - _v = (_u = context).operate; - _w = ['token']; + case 25: return [4 /*yield*/, _s.apply(_r, _t.concat([(_9.id = _14.sent(), + _9.action = 'create', + _9.data = userData, + _9), {}]))]; + case 26: + _14.sent(); _10 = {}; return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; - case 30: return [4 /*yield*/, _v.apply(_u, _w.concat([(_10.id = _11.sent(), - _10.action = 'create', - _10.data = tokenData, - _10), {}]))]; + case 27: + mobileData = (_10.id = _14.sent(), + _10.mobile = mobile, + _10.userId = userData.id, + _10); + _11 = {}; + return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; + case 28: + tokenData = (_11.id = _14.sent(), + _11.userId = userData.id, + _11.playerId = userData.id, + _11.env = env, + _11.entity = 'mobile', + _11.entityId = mobileData.id, + _11); + _v = (_u = context).operate; + _w = ['token']; + _12 = {}; + return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; + case 29: return [4 /*yield*/, _v.apply(_u, _w.concat([(_12.id = _14.sent(), + _12.action = 'create', + _12.data = tokenData, + _12), { dontCollect: true }]))]; + case 30: + _14.sent(); + return [4 /*yield*/, context.setTokenValue(tokenData.id)]; case 31: - _11.sent(); + _14.sent(); + _y = (_x = context).operate; + _z = ['mobile']; + _13 = {}; + return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; + case 32: return [4 /*yield*/, _y.apply(_x, _z.concat([(_13.id = _14.sent(), + _13.action = 'create', + _13.data = mobileData, + _13), { dontCollect: true }]))]; + case 33: + _14.sent(); return [2 /*return*/, tokenData.id]; - case 32: return [2 /*return*/]; + case 34: return [2 /*return*/]; } }); }); diff --git a/lib/auth/index.d.ts b/lib/auth/index.d.ts new file mode 100644 index 000000000..6387e40f8 --- /dev/null +++ b/lib/auth/index.d.ts @@ -0,0 +1,4 @@ +import { AuthDefDict } from 'oak-domain/lib/types/Auth'; +import { EntityDict } from '../general-app-domain'; +declare const _default: AuthDefDict; +export default _default; diff --git a/lib/auth/index.js b/lib/auth/index.js new file mode 100644 index 000000000..1fed5b32e --- /dev/null +++ b/lib/auth/index.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var mobile_1 = tslib_1.__importDefault(require("./mobile")); +// import park from './park'; +exports.default = { + mobile: mobile_1.default, +}; diff --git a/lib/auth/mobile.d.ts b/lib/auth/mobile.d.ts new file mode 100644 index 000000000..6d105a23d --- /dev/null +++ b/lib/auth/mobile.d.ts @@ -0,0 +1,4 @@ +import { AuthDef } from 'oak-domain/lib/types/Auth'; +import { EntityDict } from '../general-app-domain'; +declare const authDef: AuthDef; +export default authDef; diff --git a/lib/auth/mobile.js b/lib/auth/mobile.js new file mode 100644 index 000000000..c405c0da7 --- /dev/null +++ b/lib/auth/mobile.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var userAuth = { + cascadePath: '', +}; +var authDef = { + actionAuth: { + create: [userAuth], + } +}; +exports.default = authDef; diff --git a/lib/components/common/empty/empty.d.ts b/lib/components/common/empty/empty.d.ts index a67bcf109..5ad33b8bc 100644 --- a/lib/components/common/empty/empty.d.ts +++ b/lib/components/common/empty/empty.d.ts @@ -1,4 +1,3 @@ -/// import './index.less'; declare const Empty: () => JSX.Element; export default Empty; diff --git a/lib/components/common/empty/simple.d.ts b/lib/components/common/empty/simple.d.ts index a67bcf109..5ad33b8bc 100644 --- a/lib/components/common/empty/simple.d.ts +++ b/lib/components/common/empty/simple.d.ts @@ -1,4 +1,3 @@ -/// import './index.less'; declare const Empty: () => JSX.Element; export default Empty; diff --git a/lib/components/config/application/web.pc.d.ts b/lib/components/config/application/web.pc.d.ts index 0f8b76b9d..caa53b0c0 100644 --- a/lib/components/config/application/web.pc.d.ts +++ b/lib/components/config/application/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { AppType, WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../general-app-domain/Application/Schema'; import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/components/config/application/web/index.d.ts b/lib/components/config/application/web/index.d.ts index 90b02d1c5..b7f7da3d0 100644 --- a/lib/components/config/application/web/index.d.ts +++ b/lib/components/config/application/web/index.d.ts @@ -1,4 +1,3 @@ -/// import { WebConfig } from '../../../../general-app-domain/Application/Schema'; export default function Web(props: { config: WebConfig; diff --git a/lib/components/config/application/wechatMp/index.d.ts b/lib/components/config/application/wechatMp/index.d.ts index e70206643..cad38df4f 100644 --- a/lib/components/config/application/wechatMp/index.d.ts +++ b/lib/components/config/application/wechatMp/index.d.ts @@ -1,4 +1,3 @@ -/// import { WechatMpConfig } from '../../../../general-app-domain/Application/Schema'; export default function WechatMp(props: { config: WechatMpConfig; diff --git a/lib/components/config/application/wechatPublic/index.d.ts b/lib/components/config/application/wechatPublic/index.d.ts index 9b75714ca..10f5a622e 100644 --- a/lib/components/config/application/wechatPublic/index.d.ts +++ b/lib/components/config/application/wechatPublic/index.d.ts @@ -1,4 +1,3 @@ -/// import { WechatPublicConfig } from '../../../../general-app-domain/Application/Schema'; export default function WechatPublic(props: { isService?: boolean; diff --git a/lib/components/config/style/index.d.ts b/lib/components/config/style/index.d.ts index e94804fd5..2469d4262 100644 --- a/lib/components/config/style/index.d.ts +++ b/lib/components/config/style/index.d.ts @@ -1,4 +1,3 @@ -/// import { Style as StyleType } from '../../../types/Style'; declare type StyleProps = { value?: StyleType | null; diff --git a/lib/components/config/upsert/account/index.d.ts b/lib/components/config/upsert/account/index.d.ts index ed8ae19c5..d12966ca5 100644 --- a/lib/components/config/upsert/account/index.d.ts +++ b/lib/components/config/upsert/account/index.d.ts @@ -1,4 +1,3 @@ -/// import { Config } from '../../../../types/Config'; export default function Account(props: { account: Required['Account']; diff --git a/lib/components/config/upsert/cos/index.d.ts b/lib/components/config/upsert/cos/index.d.ts index 1be008bf7..e597fb133 100644 --- a/lib/components/config/upsert/cos/index.d.ts +++ b/lib/components/config/upsert/cos/index.d.ts @@ -1,4 +1,3 @@ -/// import { Config } from '../../../../types/Config'; export default function Cos(props: { cos: Required['Cos']; diff --git a/lib/components/config/upsert/live/index.d.ts b/lib/components/config/upsert/live/index.d.ts index 35e0ce993..e6e06424f 100644 --- a/lib/components/config/upsert/live/index.d.ts +++ b/lib/components/config/upsert/live/index.d.ts @@ -1,4 +1,3 @@ -/// import { Config } from '../../../../types/Config'; export default function Cos(props: { live: Required['Live']; diff --git a/lib/components/config/upsert/map/index.d.ts b/lib/components/config/upsert/map/index.d.ts index 7b865bc39..84db02c1b 100644 --- a/lib/components/config/upsert/map/index.d.ts +++ b/lib/components/config/upsert/map/index.d.ts @@ -1,4 +1,3 @@ -/// import { Config } from '../../../../types/Config'; export default function Cos(props: { map: Required['Map']; diff --git a/lib/components/config/upsert/sms/index.d.ts b/lib/components/config/upsert/sms/index.d.ts index 2aaa74d6e..56f0dd17c 100644 --- a/lib/components/config/upsert/sms/index.d.ts +++ b/lib/components/config/upsert/sms/index.d.ts @@ -1,4 +1,3 @@ -/// import { Config } from '../../../../types/Config'; export default function Sms(props: { sms: Required['Sms']; diff --git a/lib/components/config/upsert/web.pc.d.ts b/lib/components/config/upsert/web.pc.d.ts index 197ed9171..f99cb9476 100644 --- a/lib/components/config/upsert/web.pc.d.ts +++ b/lib/components/config/upsert/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { Config } from '../../../types/Config'; import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/components/entityActionBtn/web.d.ts b/lib/components/entityActionBtn/web.d.ts index b2e6e6b47..a78c57d43 100644 --- a/lib/components/entityActionBtn/web.d.ts +++ b/lib/components/entityActionBtn/web.d.ts @@ -1,4 +1,3 @@ -/// import { ButtonProps, SpaceProps } from 'antd'; import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../general-app-domain'; diff --git a/lib/components/extraFile/avatar/web.d.ts b/lib/components/extraFile/avatar/web.d.ts index 272e4c105..4e23c1083 100644 --- a/lib/components/extraFile/avatar/web.d.ts +++ b/lib/components/extraFile/avatar/web.d.ts @@ -1,4 +1,3 @@ -/// import { UploadFile } from 'antd'; import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; diff --git a/lib/components/extraFile/display/web.d.ts b/lib/components/extraFile/display/web.d.ts index 5eaeadcc2..cfaabf286 100644 --- a/lib/components/extraFile/display/web.d.ts +++ b/lib/components/extraFile/display/web.d.ts @@ -1,2 +1 @@ -/// export default function render(): JSX.Element; diff --git a/lib/components/extraFile/gallery/web.d.ts b/lib/components/extraFile/gallery/web.d.ts index 272e4c105..4e23c1083 100644 --- a/lib/components/extraFile/gallery/web.d.ts +++ b/lib/components/extraFile/gallery/web.d.ts @@ -1,4 +1,3 @@ -/// import { UploadFile } from 'antd'; import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; diff --git a/lib/components/func/actionPanel/web.d.ts b/lib/components/func/actionPanel/web.d.ts index bdf44b412..2ae338d31 100644 --- a/lib/components/func/actionPanel/web.d.ts +++ b/lib/components/func/actionPanel/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from "oak-frontend-base"; import { EntityDict } from "../../../general-app-domain"; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../general-app-domain'; import './web.less'; diff --git a/lib/components/message/cell/web.d.ts b/lib/components/message/cell/web.d.ts index 17b87b138..cd388ec18 100644 --- a/lib/components/message/cell/web.d.ts +++ b/lib/components/message/cell/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { MessageProps } from 'oak-frontend-base/lib/types/Message'; export default function render(props: { data: { diff --git a/lib/components/my/avatar/web.d.ts b/lib/components/my/avatar/web.d.ts index b6d4120e5..14968938d 100644 --- a/lib/components/my/avatar/web.d.ts +++ b/lib/components/my/avatar/web.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; import { AvatarSize } from 'antd/es/avatar/SizeContext'; diff --git a/lib/components/my/info/web.d.ts b/lib/components/my/info/web.d.ts index 2f8cdb25f..3c17f3482 100644 --- a/lib/components/my/info/web.d.ts +++ b/lib/components/my/info/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps extends AsyncC protected amIRoot?: boolean; protected amIReallyRoot?: boolean; protected rootMode?: boolean; + setTokenValue(tokenValue: string): Promise; protected initialize(data?: SerializedData): Promise; getApplicationId(): ED["application"]["Schema"]["id"] | undefined; getSystemId(): ED["application"]["Schema"]["systemId"] | undefined; diff --git a/lib/context/BackendRuntimeContext.js b/lib/context/BackendRuntimeContext.js index 96bd3278e..4f4806cae 100644 --- a/lib/context/BackendRuntimeContext.js +++ b/lib/context/BackendRuntimeContext.js @@ -15,9 +15,81 @@ var BackendRuntimeContext = /** @class */ (function (_super) { function BackendRuntimeContext() { return _super !== null && _super.apply(this, arguments) || this; } + BackendRuntimeContext.prototype.setTokenValue = function (tokenValue) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var result, token, user, player, userRole$user, userRole$player; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.select('token', { + data: { + id: 1, + userId: 1, + playerId: 1, + player: { + id: 1, + userState: 1, + userRole$user: { + $entity: 'userRole', + data: { + id: 1, + userId: 1, + roleId: 1, + role: { + id: 1, + name: 1, + } + }, + }, + }, + ableState: 1, + user: { + id: 1, + userState: 1, + userRole$user: { + $entity: 'userRole', + data: { + id: 1, + userId: 1, + roleId: 1, + role: { + id: 1, + name: 1, + } + }, + }, + }, + }, + filter: { + id: tokenValue, + }, + }, { + dontCollect: true, + blockTrigger: true, + })]; + case 1: + result = _a.sent(); + if (result.length === 0) { + console.log("\u6784\u5EFABackendRuntimeContext\u5BF9\u5E94tokenValue\u300C".concat(tokenValue, "\u627E\u4E0D\u5230\u76F8\u5173\u7684user")); + throw new Exception_1.OakTokenExpiredException(); + } + token = result[0]; + if (token.ableState === 'disabled') { + throw new Exception_1.OakTokenExpiredException(); + } + user = token.user, player = token.player; + userRole$user = user.userRole$user; + this.amIRoot = userRole$user.length > 0 && userRole$user.find(function (ele) { return ele.role.name === 'root'; }); + userRole$player = player.userRole$user; + this.amIReallyRoot = userRole$player.length > 0 && userRole$player.find(function (ele) { return ele.role.name === 'root'; }); + this.token = token; + return [2 /*return*/]; + } + }); + }); + }; BackendRuntimeContext.prototype.initialize = function (data) { return tslib_1.__awaiter(this, void 0, void 0, function () { - var appId, tokenValue, result, result, token, user, player, userRole$user, userRole$player, err_1; + var appId, tokenValue, result, err_1; return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: @@ -67,68 +139,9 @@ var BackendRuntimeContext = /** @class */ (function (_super) { _a.label = 4; case 4: if (!tokenValue) return [3 /*break*/, 6]; - return [4 /*yield*/, this.select('token', { - data: { - id: 1, - userId: 1, - playerId: 1, - player: { - id: 1, - userState: 1, - userRole$user: { - $entity: 'userRole', - data: { - id: 1, - userId: 1, - roleId: 1, - role: { - id: 1, - name: 1, - } - }, - }, - }, - ableState: 1, - user: { - id: 1, - userState: 1, - userRole$user: { - $entity: 'userRole', - data: { - id: 1, - userId: 1, - roleId: 1, - role: { - id: 1, - name: 1, - } - }, - }, - }, - }, - filter: { - id: tokenValue, - }, - }, { - dontCollect: true, - blockTrigger: true, - })]; + return [4 /*yield*/, this.setTokenValue(tokenValue)]; case 5: - result = _a.sent(); - if (result.length === 0) { - console.log("\u6784\u5EFABackendRuntimeContext\u5BF9\u5E94tokenValue\u300C".concat(tokenValue, "\u627E\u4E0D\u5230\u76F8\u5173\u7684user")); - throw new Exception_1.OakTokenExpiredException(); - } - token = result[0]; - if (token.ableState === 'disabled') { - throw new Exception_1.OakTokenExpiredException(); - } - user = token.user, player = token.player; - userRole$user = user.userRole$user; - this.amIRoot = userRole$user.length > 0 && userRole$user.find(function (ele) { return ele.role.name === 'root'; }); - userRole$player = player.userRole$user; - this.amIReallyRoot = userRole$player.length > 0 && userRole$player.find(function (ele) { return ele.role.name === 'root'; }); - this.token = token; + _a.sent(); _a.label = 6; case 6: return [4 /*yield*/, this.commit()]; case 7: diff --git a/lib/pages/address/list/web.d.ts b/lib/pages/address/list/web.d.ts index 931b1c0f9..151352c32 100644 --- a/lib/pages/address/list/web.d.ts +++ b/lib/pages/address/list/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { AppType, WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../../general-app-domain/Application/Schema'; import { EntityDict } from '../../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/application/detail/web.d.ts b/lib/pages/application/detail/web.d.ts index 466f965ed..abf9578b3 100644 --- a/lib/pages/application/detail/web.d.ts +++ b/lib/pages/application/detail/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../general-app-domain/Application/Schema'; import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/application/list/web.pc.d.ts b/lib/pages/application/list/web.pc.d.ts index 7d9c794d6..f83736a11 100644 --- a/lib/pages/application/list/web.pc.d.ts +++ b/lib/pages/application/list/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from './../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import '@wangeditor/editor/dist/css/style.css'; import { EntityDict } from './../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/domain/detail/web.d.ts b/lib/pages/domain/detail/web.d.ts index 9431c85e7..8703ed615 100644 --- a/lib/pages/domain/detail/web.d.ts +++ b/lib/pages/domain/detail/web.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps): JSX.Element; diff --git a/lib/pages/login/web.d.ts b/lib/pages/login/web.d.ts index c55b51a22..d1e2321ed 100644 --- a/lib/pages/login/web.d.ts +++ b/lib/pages/login/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../general-app-domain'; export default function render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/mobile/me/web.d.ts b/lib/pages/mobile/me/web.d.ts index bcd7e916b..90d439ce1 100644 --- a/lib/pages/mobile/me/web.d.ts +++ b/lib/pages/mobile/me/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function render(props: WebComponentProps export default function Render(): JSX.Element; diff --git a/lib/pages/personal/web.pc.d.ts b/lib/pages/personal/web.pc.d.ts index aa9c8f0b9..baca2f3aa 100644 --- a/lib/pages/personal/web.pc.d.ts +++ b/lib/pages/personal/web.pc.d.ts @@ -1,2 +1 @@ -/// export default function Render(): JSX.Element; diff --git a/lib/pages/pickers/area/web.d.ts b/lib/pages/pickers/area/web.d.ts index 402dea2d5..96962c2b8 100644 --- a/lib/pages/pickers/area/web.d.ts +++ b/lib/pages/pickers/area/web.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps import { Config } from '../../../../types/Config'; import { EntityDict } from '../../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/platform/detail/web.d.ts b/lib/pages/platform/detail/web.d.ts index 5cf6f9d31..e934cc279 100644 --- a/lib/pages/platform/detail/web.d.ts +++ b/lib/pages/platform/detail/web.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { Config } from '../../../types/Config'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/platform/list/web.pc.d.ts b/lib/pages/platform/list/web.pc.d.ts index 938411724..34feac623 100644 --- a/lib/pages/platform/list/web.pc.d.ts +++ b/lib/pages/platform/list/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../general-app-domain'; export default function render(props: WebComponentProps export default function Render(): JSX.Element; diff --git a/lib/pages/subscription/config/upsert/web.pc.d.ts b/lib/pages/subscription/config/upsert/web.pc.d.ts index 0c0225cc7..40fe3752c 100644 --- a/lib/pages/subscription/config/upsert/web.pc.d.ts +++ b/lib/pages/subscription/config/upsert/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WechatPublicConfig } from '../../../../general-app-domain/Application/Schema'; import { EntityDict } from '../../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/subscription/detail/web.d.ts b/lib/pages/subscription/detail/web.d.ts index d2533c1fd..858e76969 100644 --- a/lib/pages/subscription/detail/web.d.ts +++ b/lib/pages/subscription/detail/web.d.ts @@ -1,4 +1,3 @@ -/// import { WechatPublicConfig } from '../../../general-app-domain/Application/Schema'; import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/subscription/list/web.pc.d.ts b/lib/pages/subscription/list/web.pc.d.ts index b352a6947..dbad0b381 100644 --- a/lib/pages/subscription/list/web.pc.d.ts +++ b/lib/pages/subscription/list/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../../general-app-domain'; import { Config } from '../../../../types/Config'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/system/detail/web.d.ts b/lib/pages/system/detail/web.d.ts index b5371919f..cce76388c 100644 --- a/lib/pages/system/detail/web.d.ts +++ b/lib/pages/system/detail/web.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { Config } from '../../../types/Config'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/system/list/web.pc.d.ts b/lib/pages/system/list/web.pc.d.ts index 843a9d166..3f7e8af66 100644 --- a/lib/pages/system/list/web.pc.d.ts +++ b/lib/pages/system/list/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; declare type DataProps = { diff --git a/lib/pages/user/info/web.pc.d.ts b/lib/pages/user/info/web.pc.d.ts index 7cc758d26..dc7b21e6a 100644 --- a/lib/pages/user/info/web.pc.d.ts +++ b/lib/pages/user/info/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../general-app-domain'; export default function render(props: WebComponentProps import { EntityDict } from '../../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/user/search/web.d.ts b/lib/pages/user/search/web.d.ts index 5eaeadcc2..cfaabf286 100644 --- a/lib/pages/user/search/web.d.ts +++ b/lib/pages/user/search/web.d.ts @@ -1,2 +1 @@ -/// export default function render(): JSX.Element; diff --git a/lib/pages/userEntityGrant/confirm/web.d.ts b/lib/pages/userEntityGrant/confirm/web.d.ts index 1674e7f9a..c567cdf19 100644 --- a/lib/pages/userEntityGrant/confirm/web.d.ts +++ b/lib/pages/userEntityGrant/confirm/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function render(props: WebComponentProps export default function Render(props: any): JSX.Element; diff --git a/lib/pages/userEntityGrant/detail/web.pc.d.ts b/lib/pages/userEntityGrant/detail/web.pc.d.ts index b88b8c10f..17acc3779 100644 --- a/lib/pages/userEntityGrant/detail/web.pc.d.ts +++ b/lib/pages/userEntityGrant/detail/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/userRelation/onEntity/web.d.ts b/lib/pages/userRelation/onEntity/web.d.ts index ad0b8f2aa..11df1296a 100644 --- a/lib/pages/userRelation/onEntity/web.d.ts +++ b/lib/pages/userRelation/onEntity/web.d.ts @@ -1,2 +1 @@ -/// export default function render(this: any): JSX.Element; diff --git a/lib/pages/userRelation/upsert/byMobile/web.pc.d.ts b/lib/pages/userRelation/upsert/byMobile/web.pc.d.ts index ef231e514..8c8945357 100644 --- a/lib/pages/userRelation/upsert/byMobile/web.pc.d.ts +++ b/lib/pages/userRelation/upsert/byMobile/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../general-app-domain'; export default function Render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/userRelation/upsert/byUserEntityGrant/web.pc.d.ts b/lib/pages/userRelation/upsert/byUserEntityGrant/web.pc.d.ts index cc15e66f5..ce6f8ebd9 100644 --- a/lib/pages/userRelation/upsert/byUserEntityGrant/web.pc.d.ts +++ b/lib/pages/userRelation/upsert/byUserEntityGrant/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../general-app-domain'; export default function render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../../general-app-domain'; export default function Render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/userRelation/upsert/onUser/web.pc.d.ts b/lib/pages/userRelation/upsert/onUser/web.pc.d.ts index e17464587..dc6832f7c 100644 --- a/lib/pages/userRelation/upsert/onUser/web.pc.d.ts +++ b/lib/pages/userRelation/upsert/onUser/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../general-app-domain'; export default function Render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/userRelation/upsert/web.pc.d.ts b/lib/pages/userRelation/upsert/web.pc.d.ts index 728e6b575..b4e789fbc 100644 --- a/lib/pages/userRelation/upsert/web.pc.d.ts +++ b/lib/pages/userRelation/upsert/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps; \ No newline at end of file diff --git a/src/auth/mobile.ts b/src/auth/mobile.ts new file mode 100644 index 000000000..00c35f656 --- /dev/null +++ b/src/auth/mobile.ts @@ -0,0 +1,14 @@ +import { AuthDef } from 'oak-domain/lib/types/Auth'; +import { EntityDict } from '../general-app-domain'; + +const userAuth = { + cascadePath: '', +} + +const authDef: AuthDef = { + actionAuth: { + create: [userAuth], + } +}; + +export default authDef; \ No newline at end of file diff --git a/src/context/BackendRuntimeContext.ts b/src/context/BackendRuntimeContext.ts index ad721e1cc..a6fcfeecc 100644 --- a/src/context/BackendRuntimeContext.ts +++ b/src/context/BackendRuntimeContext.ts @@ -17,6 +17,74 @@ export class BackendRuntimeContext extends AsyncContext 0 && (userRole$user as any).find( + (ele: any) => ele.role.name === 'root' + ); + const { userRole$user: userRole$player} = player!; + this.amIReallyRoot = (userRole$player as any).length > 0 && (userRole$player as any).find( + (ele: any) => ele.role.name === 'root' + ); + this.token = token; + } + protected async initialize(data?: SerializedData) { if (data) { await this.begin(); @@ -61,70 +129,7 @@ export class BackendRuntimeContext extends AsyncContext 0 && (userRole$user as any).find( - (ele: any) => ele.role.name === 'root' - ); - const { userRole$user: userRole$player} = player!; - this.amIReallyRoot = (userRole$player as any).length > 0 && (userRole$player as any).find( - (ele: any) => ele.role.name === 'root' - ); - this.token = token; + await this.setTokenValue(tokenValue); } await this.commit(); }