From 76aebf4f35830a73c9d48e36b809c12213e40fa9 Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Mon, 20 Jun 2022 10:41:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=20OakI18n=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/features/token.js | 2 +- src/features/token.ts | 2 +- src/typings/polyfill.d.ts | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/features/token.js b/lib/features/token.js index 8dfe76f64..20b1305c8 100644 --- a/lib/features/token.js +++ b/lib/features/token.js @@ -103,7 +103,7 @@ class Token extends oak_frontend_base_1.Feature { id: token, } }, 'token:getUserId'); - return result[0].userId; + return result[0]?.userId; } } __decorate([ diff --git a/src/features/token.ts b/src/features/token.ts index e7957b82b..cfcc0665f 100644 --- a/src/features/token.ts +++ b/src/features/token.ts @@ -114,6 +114,6 @@ export class Token, AD extends Re id: token!, } }, 'token:getUserId'); - return result[0].userId; + return result[0]?.userId; } } \ No newline at end of file diff --git a/src/typings/polyfill.d.ts b/src/typings/polyfill.d.ts index 78cdc8f14..e4c0b01f6 100644 --- a/src/typings/polyfill.d.ts +++ b/src/typings/polyfill.d.ts @@ -1,4 +1,4 @@ -import { MakeOakComponent, MakeOakPage, I18nWechatMpRuntimeBase } from 'oak-frontend-base'; +import { MakeOakComponent, MakeOakPage } from 'oak-frontend-base'; import { EntityDict } from 'general-app-domain'; import { GeneralRuntimeContext } from '../RuntimeContext'; import aspectDict from '../aspects'; @@ -18,8 +18,5 @@ declare global { ReturnType >; const generateNewId: (options?: { timestamp?: boolean }) => Promise; - const OakI18n: { - i18nInstance: I18nWechatMpRuntimeBase | null; - }; } export {} \ No newline at end of file