Browse Source

企业微信版本号

xiuli.gao 2 years ago
parent
commit
4537ec05d2

File diff suppressed because it is too large
+ 1 - 1
qwh5/dist/css/userPortrait.982a5ca4.css


File diff suppressed because it is too large
+ 1 - 1
qwh5/dist/index.html


File diff suppressed because it is too large
+ 1 - 1
qwh5/dist/js/app.a04923c6.js


File diff suppressed because it is too large
+ 1 - 1
qwh5/dist/js/userPortrait.37805912.js


+ 9 - 3
qwh5/src/views/userPortrait.vue

@@ -194,9 +194,15 @@ export default {
194 194
       // user_id: '8a82d12ae22e0cedd81ae297a2e7c1fa'
195 195
     })
196 196
     onBeforeMount(() => {//组件挂载之前
197
-      var wechatInfo = navigator.userAgent.match(/wxwork\/([d.]+)/);
198
-      if (!wechatInfo) { alert(wechatInfo + "本活动仅支持微信"); }
199
-      else if (wechatInfo[1] < "5.0") { alert(wechatInfo[1] + "本活动仅支持微信5.0以上版本"); }
197
+      function isWxwork() {//判断是否为企业微信,并获取企业微信版本号
198
+        let arr1 = navigator.userAgent.split('wxwork/');
199
+        if (arr1.length > 1) {//是在企业微信内
200
+          return arr1[1].split(' ')[1]
201
+        } else {
202
+          return false
203
+        }
204
+      }
205
+      console.log(isWxwork())
200 206
 
201 207
       // pageLoading.value = true;
202 208
       // get_data_init()