扫小程序码 无法传递scene参数
发布于 6 年前 作者 jun15 12902 次浏览 来自 问答

微信开发工具v1.02.1902010 -> 通过二维码编译 -> 选择生成的小程序码图片   扫描后没有在index.js的onLoad函数里获取到scene

生成小程序码的代码:

access_token_parms = {'grant_type':'client_credential','appid':settings.WXSM_APPID,'secret':settings.WXSM_SRECRET}
access_token_rtn = requests.get('https://api.weixin.qq.com/cgi-bin/token',params=access_token_parms)

access_token = access_token_rtn.json()['access_token']

wxacode_rtn = requests.post('https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token='+access_token,json={'scene':'2'})
return HttpResponse(wxacode_rtn.content, content_type="image/png")

开发者工具调试的结果:

2 回复

写法我看着有点诡异,post传参是这么写的么?

回到顶部