From 0b680c376a55d1c502db611e286e00062e3e5aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E7=90=AA?= Date: Fri, 14 Jun 2024 17:38:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(harmony):=20=E4=BF=AE=E5=A4=8DgetBaseSystem?= =?UTF-8?q?Info=E5=9C=A8view=E5=B1=82=E8=B0=83=E7=94=A8=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/service/api/base/getBaseSystemInfo.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/uni-app-harmony/src/service/api/base/getBaseSystemInfo.ts b/packages/uni-app-harmony/src/service/api/base/getBaseSystemInfo.ts index 093643a35e..abf85b889e 100644 --- a/packages/uni-app-harmony/src/service/api/base/getBaseSystemInfo.ts +++ b/packages/uni-app-harmony/src/service/api/base/getBaseSystemInfo.ts @@ -6,11 +6,13 @@ declare function lpx2px(value: number): number * @returns */ export function getBaseSystemInfo() { - const plus = weex.requireModule('plus') + // @ts-expect-error view 层 + if (typeof __SYSTEM_INFO__ !== 'undefined') { + return (window as any).__SYSTEM_INFO__ + } return { platform: 'harmony', pixelRatio: vp2px(1), windowWidth: lpx2px(720), // TODO designWidth可配置 - language: plus.getLanguage(), } } -- GitLab