|
@@ -1,14 +1,16 @@
|
|
|
-(
|
|
|
- // import store from ''
|
|
|
- function() {
|
|
|
- console.log("判断移动端");
|
|
|
- var sUserAgent = navigator.userAgent.toLowerCase();
|
|
|
- if (/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(sUserAgent)) {
|
|
|
- console.log("移动端-----");
|
|
|
- //跳转移动端页面
|
|
|
- // window.location.href()
|
|
|
- // window.location.replace("n_user");//跳转后没有后退功能
|
|
|
+;(function () {
|
|
|
+ // 判断移动端
|
|
|
+ var sUserAgent = navigator.userAgent.toLowerCase()
|
|
|
+ if (
|
|
|
+ /ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(
|
|
|
+ sUserAgent
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ //跳转移动端页面
|
|
|
+ if (window.location.href.indexOf('mobile') < 0) {
|
|
|
+ window.location.replace('/user/m_user') //跳转后没有后退功能
|
|
|
+ }
|
|
|
} else {
|
|
|
- console.log("PC端");
|
|
|
+ // PC端
|
|
|
}
|
|
|
-})();
|
|
|
+})()
|