Skip to content

fly请求微信的code2Session对返回的结果取data项返回的是字符串,而不是对象,我们必须手动去转换下 #282

@superBiuBiuMan

Description

@superBiuBiuMan
  • fly请求微信的code2Session对返回的结果取data项返回的是字符串,而不是对象,我们必须手动去转换下才可以转化为JSON对象,而axios的则不用,这是为什么啊?
let result = await fly.get("https://api.weixin.qq.com/sns/jscode2session", {
    appid,
    secret,
    js_code,
    grant_type: "authorization_code",
});
console.log(result.data);
console.log("fly时候返回的结果",typeof result.data);

202207211035160

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions