我提交小程序代码的时候添加了 ext_json 但是感觉并没有作用,请问这个是为什么?下面是我的请求log
/wxa/commit?access_token=52_SU-3spzefbuZ6WD1k6pNEBE79-vAcPryaSIBR9OeHKEKg04ENKH7SXXi9tVgwlUMbUIH1pXV9twIAUSnDSCQ6_owqn_DYVmCbMeNnzktBpHVi2kngWsxprAAozo5CwAC0qIBcLnzHyaF3qrcUSPdAEDFDA HTTP/1.1 Host: api.weixin.qq.com Content-Length: 588 User-Agent: GuzzleHttp/6.3.3 curl/7.64.0 PHP/7.2.15 Content-Type: application/json {"template_id":1,"ext_json":"{\"extEnable\":true,\"extAppid\":\"wxd22a4800646d0c07\",\"directCommit\":true,\"ext\":{\"name\":\"\\u6d4b\\u8bd5\\u5e73\\u53f02.0\",\"homeUrl\":\"http:\\\/\\\/new-demo.51stark.com\\\/api\\\/session\\\/wx-base-login?company=newstark\"},\"window\":{\"backgroundTextStyle\":\"dark\",\"navigationBarBackgroundColor\":\"#FFFFFF\",\"navigationBarTitleText\":\"\\u601d\\u8fbe\\u5ba2\\u6559\\u80b2\\u79d1\\u6280\",\"navigationBarTextStyle\":\"black\",\"backgroundColor\":\"#FFFFFF\",\"enablePullDownRefresh\":true}}","user_version":"1.0.1","user_desc":"再次发版"} <<<<<<<< HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 27 {"errcode":0,"errmsg":"ok"} --------
小程序端读出来对照
wx.getExtConfigSync
let ext_json = { "extAppid": '', "ext": {}, "window": {} }
let body = {
template_id: pkg.template.template_id || 0,
ext_json: JSON.stringify(ext_json),
user_version: pkg.template.user_version || 'v1.0.0',
user_desc: pkg.template.user_desc || "test"
}
用request-promise发送