 var os = fBrowser()
 var origin = window.location.origin;
 var pathname = window.location.pathname;
 var search = window.location.search;
 // 如果不是pc 并且不是平板 并且是pc的地址 跳转到mobile
 if (os == 'mobile') {
     window.location.href = origin + pathname + 'mobile.html' + search
 }


 //判断是pc还是移动
 function fBrowser() {
     var sUserAgent = navigator.userAgent.toLowerCase();
     if ((sUserAgent.match(/(iphone|ipod|android|ios|ipad|backerry|webos|symbian|windows phone|phone|mobile|webos|incognito|webmate|bada|nokia|lg|ucweb|skyfire)/i))) {
         //手机访问
         return "mobile";
     } else {
         //电脑访问
         return "pc";
     }
 }