JSSDK 在 MAC 客户端与 iOS 客户端均初始化失败 (昨天开发时是正常的,未修改任何参数)

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 21:05 1614 0 全屏看文

AI助手支持GPT4.0

JSSDK 在 MAC 客户端与 iOS 客户端均初始化失败 (昨天开发时是正常的,未修改任何参数)
问题类型 API/组件名称 终端类型 微信版本 基础库版本
Bug JSSDK 微信iOS客户端 3.0.25 jweixin-1.2.0.js

如题,昨天开发时没有问题,今天未修改任何代码的情况下,初始化 JSSDK (通过agentConfig注入应用的权限) 出现如下错误:

{	"errMsg": "agentConfig:fail_ticket no available more info at https://open.work.weixin.qq.com/devtool/query?e=42012",	"err_msg": "agentConfig:fail_ticket no available more info at https://open.work.weixin.qq.com/devtool/query?e=42012"}


iOS 企业微信版本: 3.0.25

JSSDK 版本: jweixin-1.2.0.js

Mac 企业微信版本: 3.0.25.2257

企业 ID: ww80a86e58dace30a9

应用ID: 1000011

代码 (使用 Easywechat 第三方库生成 signature):

wx.config(<?php echo $config ?>);wx.ready(() => {  wx.agentConfig({    corpid: 'ww80a86e58dace30a9', // 必填,企业微信的corpid,必须与当前登录的企业一致    agentid: 1000011, // 必填,企业微信的应用id (e.g. 1000247)    timestamp: "{{$arr_config['timestamp']}}", // 必填,生成签名的时间戳    nonceStr: "{{$arr_config['nonceStr']}}", // 必填,生成签名的随机串    signature: "{{$sign}}",// 必填,签名,见附录-JS-SDK使用权限签名算法    jsApiList: ['getCurExternalContact'], //必填    success: (res) => {      wx.invoke('getCurExternalContact', {}, (res) => {        if (res.err_msg == "getCurExternalContact:ok") {          userId = res.userId          alert(userId)        } else {          alert(JSON.stringify(res))        }      });    },    fail: function (res) {      alert(JSON.stringify(res));    }  });});

Problem type API / component name terminal type wechat version basic library version bug jssdk wechat IOS client 3.0.25 jweixin-1.2.0.js is the problem. There was no problem in the development yesterday. Without modifying any code today, the following error occurs in initializing jssdk (injecting application permissions through agentconfig): {"errmsg": "Ag" entConfig:fail_ ticket no available more info at https://open.work.weixin.qq.com/devtool/query?e=42012 ", "err_ msg": "ag entConfig:fail_ ticket no available more info at https://open.work.weixin.qq.com/devtool/query?e=42012 "} IOS enterprise wechat version: 3.0.25 jssdk version: jweixin-1.2.0.js MAC enterprise wechat version: 3.0.25.2257 enterprise ID: ww80a86e58dace30a9 application ID: 1000011 code (using easywechat third-party library to generate signature):" wx.config (); wx.ready (() => { wx.agentConfig ({Corpid: 'ww80a86e58dace30a9', / / required, the Corpid of enterprise wechat must be the same as the currently logged in enterprise, AgentID: 1000011, / / required, application ID (e.g. 1000247) timestamp of enterprise wechat: "err_ Config ['timestamp ']}} ", / / required. The timestamp for generating the signature: noncestr:" {{$arr_ Config ['noncestr ']}} ", / / required. The random string signature is" {{$sign}} "/ / required. For signature, see appendix - js-sdk permission signature algorithm jsapilist: ['getcurexternalcontact'], / / required success: (RES) = >{ wx.invoke ('getCurExternalContact', {}, (res) => { if ( res.err_ msg == "getCurExtern alContact:ok ") { userId = res.userId alert(userId) } else { alert( JSON.stringify (res)) } }); }, fail: function (res) { alert( JSON.stringify (res)); } });});

回答:

企业微信运营专员-千夜:

您好,看日志报错是提示js_ticket_empty ticket为空,检查下是否没有将ticket传入参数进行签名计算

Seaony:实际测试之后ticket是参与了签名计算的,目前代码昨天是正常可以运行的,今天就疯狂4201,可以麻烦你们再排查一下吗?
企业微信运营专员-千夜:我看日志就是config里面就是提示ticket为空的,你们检查下后端是不是没发送进去
Seaony:排查了一下,确定后端在生成签名时有加入 js_ticket,并且 js_ticket 是使用获取第三方应用的接口获取的...
Seaony:经过排查后所有参数确实都没有问题,麻烦再帮我们排查一下吧...你们可以自己跑一下看看,辛苦了 0.0
企业微信运营专员-千夜:你们重新调用接口生成个签名,然后提供下调用时间看下
企业微信运营专员-千夜:提供下签名

-EOF-

AI助手支持GPT4.0