Răsfoiți Sursa

企业微信PC版打不开--兼容

hbchen 2 ani în urmă
părinte
comite
499aab1a92
1 a modificat fișierele cu 11 adăugiri și 1 ștergeri
  1. 11 1
      pages/pc.vue

+ 11 - 1
pages/pc.vue

@@ -110,7 +110,17 @@ export default {
                 }
             }
             console.log('拼接字符串:',paramsObjStr);
-            this.url=`${pcBaseUrl}${mapObj.get(decodeURIComponent(options.xcxPath))||'/'}?${paramsObjStr}#wechat_redirect`
+			uni.getSystemInfo({
+					success: (data) => {
+						// 企业微信会额外返回一个 environment 字段 值为 wxwork 在企业微信PC版中,一旦后缀带上#wechat_redirect ,就打不开,不知道为何,社区也没有找到什么结果
+						this.url=`${pcBaseUrl}${mapObj.get(decodeURIComponent(options.xcxPath))||'/'}?${paramsObjStr}${data.environment?'':'#wechat_redirect'}`
+                        // console.log(`${pcBaseUrl}${mapObj.get(decodeURIComponent(options.xcxPath))||'/'}?${paramsObjStr}${data.environment?'':'#wechat_redirect'}`);
+					},
+					fail: (err) => {
+						console.log(err);
+					}
+			})
+            
         }
     },