首先通过 https://api.weixin.qq.com/wxa/get_category?access_token=TOKEN 获取的数据为
{errcode: 0,
errmsg: "ok",
category_list: [
{
first_class: "工具",
second_class: "记账",
third_class: ""
}
]
}
通过 https://api.weixin.qq.com/wxa/submit_audit?access_token=TOKEN 将第三方代码包提交审核时 数据为
{
"item_list": [
{
"address":"pages/index/index",
"tag":"工具",
"first_class": "工具",
"second_class": "记账",
"third_class" : "",
"title": "首页"
}
]
}
显示结果为{“errcode”:85008, “errmsg” : “category is in invalid format hint: [AbG2Ja0284e626]”}
换了一个授权小程序测试
通过 https://api.weixin.qq.com/wxa/get_category?access_token=TOKEN 获取的数据为
{
errcode: 0,
errmsg: "ok",
category_list: [
{
first_class: "工具",
second_class: "信息查询"
},
{
first_class: "教育",
second_class: "教育信息服务"
}
]
}
通过 https://api.weixin.qq.com/wxa/submit\_audit?access\_token=TOKEN 将第三方代码包提交审核时 数据为
{
"item_list": [
{
"address":"pages/index/index",
"tag":"工具",
"first_class": "工具",
"second_class": "信息查询",
"title": "首页"
}
]
}
显示结果 同为{"errcode":85008, "errmsg" : "category is in invalid format hint"}
楼主也是 python 吧,是编码问题,按照微信对中文的一贯处理习惯,是没法很好处理 /u 这样的编码的。
需要:
json.dumps(payload, ensure_ascii=False).encode(“utf-8”)
json_encode($data,JSON_UNESCAPED_UNICODE)中的$data是
Array ( [item_list] => Array ( [0] => Array ( [address] => pages/playsong/playsong [tag] => 啊啊啊 [first_class] => 生活服务 [second_class] => 票务 [third_class] => 电影票 [title] => 心得写成 ) )),
json_encode后是
{"item_list":"[{\"address\":\"pages\\\/playsong\\\/playsong\",\"tag\":\"啊啊啊\",\"first_class\":\"生活服务\",\"second_class\":\"票务\",\"third_class\":\"电影票\",\"title\":\"心得写成\"}]"},但是接口返回
[errno] => 47001[message] => 解析JSON/XML内容错误
)@刘俊宇