Pārlūkot izejas kodu

fix:判断跳转

shenchunlv 2 gadi atpakaļ
vecāks
revīzija
312b77c010
2 mainītis faili ar 7 papildinājumiem un 2 dzēšanām
  1. 4 1
      nuxt.config.ts
  2. 3 1
      public/isMobile.js

+ 4 - 1
nuxt.config.ts

@@ -7,6 +7,9 @@ export default defineNuxtConfig({
         { name: "description", content: "惠融易客助贷系统是一套专门为助贷机构量身打造的金融中介精准获客服务平台。一站式帮助助贷机构,金融居间公司,银行贷款中介老板解决获客难,转化差,管理难等业务难题,提高销售人员效率,提升销售团队业绩!现在申请,可立即试用!" },
         { name: "keywords", content: "助贷获客,信贷拓客,金融中介CRM系统" },
       ],
+      script:[
+        {src:"isMobile.js"}
+      ]
     },
   },
   plugins: [
@@ -29,7 +32,7 @@ export default defineNuxtConfig({
     '@vant/nuxt',
   ],
   vant:{
-    
+
   },
   build:{
     transpile: [/^vant-ui/]

+ 3 - 1
require/isMobile.js → public/isMobile.js

@@ -1,4 +1,5 @@
 ;(function () {
+  console.log('进来了')
   // 判断移动端
   var sUserAgent = navigator.userAgent.toLowerCase()
   if (
@@ -8,10 +9,11 @@
   ) {
     //跳转移动端页面
     if (window.location.href.indexOf('mobile') < 0) {
-      window.location.replace('/user/m_user') //跳转后没有后退功能
+      window.location.replace('/m_user') //跳转后没有后退功能
     }
   } else {
     // PC端
+    console.log('pc')
   }
 })()
 (function(window){