先上目录结构
纯前端js就可以实现 ,index.html 入口文件的代码贴上,简单几行即可实现 <script type="text/javascript"> function browserRedirect() { var sUserAgent = navigator.userAgent.toLowerCase(); if (/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(sUserAgent)) { //跳转移动端页面 window.location.href="./wap/wap-index.html"; } else { //跳转pc端页面 window.location.href="./pc/index.html"; } } browserRedirect(); </script>