mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
mobile增加识别鸿蒙系统 (#2571)
由于鸿蒙系统的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
This commit is contained in:
parent
fff572869e
commit
02c6ad8004
|
@ -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';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user