Commit bfc47982 by wufan

fix:调整

parent 69a1b415
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2021-05-11 10:21:37 * @Date: 2021-05-11 10:21:37
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-06-02 15:02:53 * @LastEditTime: 2021-06-02 15:27:35
* @Description: 企业微信api * @Description: 企业微信api
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -15,9 +15,9 @@ export default class WechatApi { ...@@ -15,9 +15,9 @@ export default class WechatApi {
return Service.Hades("anon/hades/getWxCorpJSAPISignature", { return Service.Hades("anon/hades/getWxCorpJSAPISignature", {
storeId: User.getStoreId(), storeId: User.getStoreId(),
url: params.url, url: params.url,
}).then( await function(result) { }).then(
await function (result) {
const res = result.result; const res = result.result;
if (/MicroMessenger/i.test(navigator.userAgent)) {
this.config({ this.config({
beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题 beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
...@@ -32,14 +32,15 @@ export default class WechatApi { ...@@ -32,14 +32,15 @@ export default class WechatApi {
"selectEnterpriseContact", "selectEnterpriseContact",
], ],
}); });
}
if (params.isAgentConfig) { if (params.isAgentConfig) {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
wx.ready(() => {
Service.Hades("anon/hades/getWxWorkJSAPISignature", { Service.Hades("anon/hades/getWxWorkJSAPISignature", {
storeId: User.getStoreId(), storeId: User.getStoreId(),
url: params.url, url: params.url,
}).then(await function(result2) { }).then(
await function (result2) {
const res2 = result2.result; const res2 = result2.result;
this.agentConfig({ this.agentConfig({
corpid: res2.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致 corpid: res2.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
...@@ -65,10 +66,13 @@ export default class WechatApi { ...@@ -65,10 +66,13 @@ export default class WechatApi {
reject(err); reject(err);
}, },
}); });
}
);
}); });
}); });
} }
}); }
);
} }
static async config(config) { static async config(config) {
......
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