// 这个函数用来检测是否是移动设备
function isMobileDevice() {
return /Mobi|Android|iPhone/.test(navigator.userAgent);
}
// 这里假设你的企业web端网站和移动端网站的URL
const webURL = 'http://www.zecers.com';
const mobileURL = 'http://m.zecers.com';
// 判断设备类型并重定向
if (isMobileDevice()) {
window.location.href = mobileURL; // 如果是移动设备,重定向到移动端网站
} else {
window.location.href = webURL; // 如果不是移动设备,重定向到web端网站
}