//判断系统类型
function OSnow() {
const agent = navigator.userAgent.toLowerCase()
const isMac = /macintosh|mac os x/i.test(navigator.userAgent)
if (agent.indexOf('win32') >= 0 || agent.indexOf('wow32') >= 0) {
//your code
alert('这是windows32位系统')
}
if (agent.indexOf('win64') >= 0 || agent.indexOf('wow64') >= 0) {
//your code
alert('这是windows64位系统')
}
if (isMac) {
//your code
alert('这是mac系统')
}
}
OSnow()
```
传送门:https://juejin.cn/post/6854573221614714893
标签:code,indexOf,Win,agent,JS,mac,alert,your
From: https://www.cnblogs.com/DL-CODER/p/17392925.html