|
@@ -26,6 +26,7 @@ export function obtainEnterpriseWeChatParameters(data = {}) {
|
|
|
const token = data.id
|
|
|
const curUrl = window.location.href.split('#')[0]
|
|
|
requests.post(`/wxcorp/getCorpWXConfig`, { url: curUrl, token }).then((res) => {
|
|
|
+ console.log(res, '<====== 返回的参数 /wxcorp/getCorpWXConfig')
|
|
|
wx.config({
|
|
|
beta: true,
|
|
|
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
@@ -39,6 +40,7 @@ export function obtainEnterpriseWeChatParameters(data = {}) {
|
|
|
wx.ready(function () {
|
|
|
// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
|
|
|
requests.post(`/wxcorp/getCorpWXAgentConfig`, { url: curUrl, token }).then((res) => {
|
|
|
+ console.log(res, '<====== 返回的参数 /wxcorp/getCorpWXAgentConfig')
|
|
|
wx.agentConfig({
|
|
|
corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
|
|
|
agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
|