瀏覽代碼

no message

zhujindu 8 月之前
父節點
當前提交
5b9162e8e2
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      src/utils/TXApiFun.js

+ 8 - 2
src/utils/TXApiFun.js

@@ -96,8 +96,14 @@ export function getTicketFun(jsApiList = ['getLocation'], configType = 'config')
   return new Promise((resolve, reject) => {
     // 当前页面
     let url = window.location.href;
+    let params = {
+      url: url,
+    };
+    if (configType == 'agentConfig') {
+      params.agent = 1;
+    }
     //  获取签名
-    getTicket({ url: url }).then((response) => {
+    getTicket(paramss).then((response) => {
       console.log(response);
       toastLoading().clear();
       if (response.code == 200) {
@@ -117,7 +123,7 @@ export function getTicketFun(jsApiList = ['getLocation'], configType = 'config')
         } else if (configType == 'agentConfig') {
           wx.agentConfig({
             corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
-            agentid: '1000089', // 必填,企业微信的应用id (e.g. 1000247)
+            agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
             timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
             nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
             signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法