收藏
回答

生成的微信小程序二维码scene参数和我传的参数不一致

使用B接口:https://api.weixin.qq.com/wxa/getwxacodeunlimit 生成小程序二维码,传入参数是:"{"page":"pages/class/class","scene":412213075488489472}"

但生成的二维码,小程序获取到的scene不是412213075488489472。


奇怪的是:小程序获取到测参数是:http请求日志中的"Content-disposition: attachment; filename="_412213075488489536"[\r][\n]" 

难道是微信的坑?


以下是调用微信接口的http请求日志:

 http-outgoing-24 >> "POST /wxa/getwxacodeunlimit?access_token=token HTTP/1.1[\r][\n]"              

 - http-outgoing-24 >> "Content-Length: 55[\r][\n]"                        

 - http-outgoing-24 >> "Content-Type: application/json[\r][\n]"            

 - http-outgoing-24 >> "Content-Encoding: utf-8[\r][\n]"                   

 - http-outgoing-24 >> "Host: api.weixin.qq.com[\r][\n]"                   

 - http-outgoing-24 >> "Connection: Keep-Alive[\r][\n]"                    

 - http-outgoing-24 >> "User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_151)[\r][\n]"                                                                                                                                                                         

 - http-outgoing-24 >> "Accept-Encoding: gzip,deflate[\r][\n]"             

 - http-outgoing-24 >> "[\r][\n]"                                          

 - http-outgoing-24 >> "{"page":"pages/class/class","scene":412213075488489472}"                                                                                                                                                                              

 - http-outgoing-24 << "HTTP/1.1 200 OK[\r][\n]"                           

 - http-outgoing-24 << "Connection: keep-alive[\r][\n]"                    

 - http-outgoing-24 << "Cache-Control: no-cache, must-revalidate[\r][\n]"  

 - http-outgoing-24 << "Content-Type: image/jpeg[\r][\n]"                  

 - http-outgoing-24 << "Content-disposition: attachment; filename="_412213075488489536"[\r][\n]"                                                                                                                                                              

 - http-outgoing-24 << "Content-Length: 99842[\r][\n]"                     

 - http-outgoing-24 << "[\r][\n]"


回答关注问题邀请回答
收藏

4 个回答

  • AndyChao
    AndyChao
    2023-08-03

    scence 赋值的时候必须是string类型的,不要用Long否则获取到的scence会不一致

    2023-08-03
    有用 1
    回复
  • 欣路
    欣路
    2020-09-15

    请问,这个问题找到原因了吗?

    2020-09-15
    有用 1
    回复 3
    • 💐
      💐
      2021-03-26
      请问解决了吗
      2021-03-26
      回复
    • Answer
      Answer
      2021-03-26
      请问解决方案有么
      2021-03-26
      回复
    • 小程序技术专员-binnie
      小程序技术专员-binnie
      2021-04-01回复Answer
      获取到的scence是什么呢?
      2021-04-01
      回复
  • 佛曰ᯤ²ᴳ
    佛曰ᯤ²ᴳ
    2023-04-25

    请问解决了吗。相同问题

    2023-04-25
    有用
    回复
  • bamboo
    bamboo
    2020-09-15

    同问解决了吗?

    2020-09-15
    有用
    回复 1
    • Answer
      Answer
      2021-03-26
      请问解决了么
      2021-03-26
      回复
登录 后发表内容