Commit 0609f943 by zhujian

fix

parent 347c4224
...@@ -36,24 +36,27 @@ export default class WechatApi { ...@@ -36,24 +36,27 @@ export default class WechatApi {
url: params.url, url: params.url,
}).then((result2) => { }).then((result2) => {
const res2 = result2.result; const res2 = result2.result;
this.agentConfig({ setTimeout(() => {
corpid: res2.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致 this.agentConfig({
agentid: res2.agentid, // 必填,企业微信的应用id (e.g. 1000247) corpid: res2.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
timestamp: res2.timestamp, // 必填,生成签名的时间戳 agentid: res2.agentid, // 必填,企业微信的应用id (e.g. 1000247)
nonceStr: res2.nonceStr, // 必填,生成签名的随机串 timestamp: res2.timestamp, // 必填,生成签名的时间戳
signature: res2.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法 nonceStr: res2.nonceStr, // 必填,生成签名的随机串
jsApiList: ['selectExternalContact', 'getCurExternalContact', 'getContext', 'shareToExternalContact', 'sendChatMessage', 'shareToExternalChat'], signature: res2.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
success: (res) => { jsApiList: ['selectExternalContact', 'getCurExternalContact', 'getContext', 'shareToExternalContact', 'sendChatMessage', 'shareToExternalChat'],
console.log(res, 'res-agentconfig'); success: (res) => {
console.info('window.WWOpenData', window.WWOpenData); console.log(res, 'res-agentconfig');
resolve(res); console.info('window.WWOpenData', window.WWOpenData);
}, resolve(res);
fail: (err) => { },
console.log(1213545344545) fail: (err) => {
console.log(err, 'err-agentconfig'); console.log(1213545344545)
reject(err); console.log(err, 'err-agentconfig');
}, reject(err);
}); },
});
}, 500)
}); });
}) })
...@@ -93,7 +96,7 @@ export default class WechatApi { ...@@ -93,7 +96,7 @@ export default class WechatApi {
}); });
} }
} }
} }
static async config(config) { static async config(config) {
...@@ -150,13 +153,13 @@ export default class WechatApi { ...@@ -150,13 +153,13 @@ export default class WechatApi {
wx.ready(() => { wx.ready(() => {
wx.invoke('startLiving', { wx.invoke('startLiving', {
"livingId": id, "livingId": id,
}, function(res) { }, function (res) {
if (res.err_msg === "startLiving:ok") { if (res.err_msg === "startLiving:ok") {
resolve(true) resolve(true)
} else { } else {
reject(res.err_msg); //错误处理 reject(res.err_msg); //错误处理
} }
}); });
}); });
}) })
} }
...@@ -165,7 +168,7 @@ export default class WechatApi { ...@@ -165,7 +168,7 @@ export default class WechatApi {
wx.ready(() => { wx.ready(() => {
wx.invoke('replayLiving', { wx.invoke('replayLiving', {
"livingId": id, "livingId": id,
}, function(res) { }, function (res) {
if (res.err_msg === "replayLiving:ok") { if (res.err_msg === "replayLiving:ok") {
resolve(true) resolve(true)
} else { } else {
...@@ -189,7 +192,7 @@ export default class WechatApi { ...@@ -189,7 +192,7 @@ export default class WechatApi {
} }
reject(err); //错误处理 reject(err); //错误处理
} }
}); });
}); });
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment