Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
superBiuBiuMan opened this issue Jul 21, 2022 · 3 comments

Comments

@superBiuBiuMan
Copy link

  • 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

@puzzle9
Copy link

puzzle9 commented Jul 29, 2022

这吧 得看下后端接口返回头部是啥 可能axios先处理了下吧

不过 这接口 不应该后端调用的吗

@superBiuBiuMan
Copy link
Author

这吧 得看下后端接口返回头部是啥 可能axios先处理了下吧

不过 这接口 不应该后端调用的吗

我也猜可能是axios处理了下,后端调用没错,感兴趣,因为我发现视频中老师要解析下,而axios不用,就感觉很好奇

@puzzle9
Copy link

puzzle9 commented Jul 31, 2022

这吧 得看下后端接口返回头部是啥 可能axios先处理了下吧
不过 这接口 不应该后端调用的吗

我也猜可能是axios处理了下,后端调用没错,感兴趣,因为我发现视频中老师要解析下,而axios不用,就感觉很好奇

老师讲入门,编程都是相通的,加油

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants