From 1032339af21cf15a4bdb1525617f0bacd0129b9d Mon Sep 17 00:00:00 2001 From: xiaobingtech <161550081+xiaobingtech@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:39:23 +0800 Subject: [PATCH] =?UTF-8?q?mobile=E5=A2=9E=E5=8A=A0=E9=B8=BF=E8=92=99?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于鸿蒙系统的User-Agent如下 Mozilla/5.0 (Phone; OpenHarmony5.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 ArkWeb/4.1.6.1 Mobile 导致目前登录显示desktop 此PR修改默认desktop为mobile --- back/config/util.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/back/config/util.ts b/back/config/util.ts index e5aa24c7..b5b25d5b 100644 --- a/back/config/util.ts +++ b/back/config/util.ts @@ -145,12 +145,14 @@ export function getPlatform(userAgent: string): 'mobile' | 'desktop' { system = 'android'; // android系统 } else if (testUa(/ios|iphone|ipad|ipod|iwatch/g)) { system = 'ios'; // ios系统 + } else if (testUa(/openharmony/g)) { + system = 'openharmony'; // openharmony系统 } let platform = 'desktop'; if (system === 'windows' || system === 'macos' || system === 'linux') { platform = 'desktop'; - } else if (system === 'android' || system === 'ios' || testUa(/mobile/g)) { + } else if (system === 'android' || system === 'ios' || system === 'openharmony' || testUa(/mobile/g)) { platform = 'mobile'; }