fix(utils): fix isPC. fixed #644

This commit is contained in:
Soybean 2024-10-16 12:10:00 +08:00
parent 75cbfbbfe6
commit 4726498faa

View File

@ -1,5 +1,7 @@
export function isPC() {
const agents = ['Android', 'iPhone', 'webOS', 'BlackBerry', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];
return !agents.includes(window.navigator.userAgent);
const isMobile = agents.some(agent => window.navigator.userAgent.includes(agent));
return !isMobile;
}