Openid acquisition failed errcode 40029 errmsg “invalid code, rid: 643e7e48-3d5b7ec3-66ca1f03”

Table of contents

question image

Send a websocket request, the returned websocket data is incorrect
insert image description here
insert image description here
insert image description here

problem causes

Obtaining the openid interface The js_code in the interface address is uname
when obtaining the openid - the reason

  • When sending a websocket request, the passed uname is the login credential Taro.login()obtained code, and the uname (that is, code) openidis used to
  • However, the appid of the applet configured by the current WeChat developer tool is inconsistent with the wxappid in the sent websocket → the obtained code is taken from the appid configured by the WeChat developer tool, and the two do not match
  • So get openid request failed
    insert image description here

solve

微信开发者工具配置的 小程序 appid Change it to be the same as the wxappid carried when sending websocket

Guess you like

Origin blog.csdn.net/m0_53562074/article/details/130229097