weidian-inc / hera

A framework for running WeChat applet. (小程序 SDK,小程序转 H5,小程序转安卓、iOS 原生应用、小程序渲染引擎)
https://weidian-inc.github.io/hera
Other
1.48k stars 315 forks source link

android打包后,使用微信API,("wx.request()")调不到后台接口数据 #22

Open mingsong2 opened 6 years ago

mingsong2 commented 6 years ago

使用hera对小程序打包成android应用后,静态页面可以正常显示,但是调用后台接口出现错误,hera可以使用“wx.request()”来调用后台接口吗?

dingtalk20180102162411

dingtalk20180102162526

IOriens commented 6 years ago

请求接口应该是没问题的,你可以用 chrome://inspect/#devices 调试看下有没有返回值。

mingsong2 commented 6 years ago

在 2018年1月2日,下午5:12,Junjie Ding notifications@github.com 写道:

请求接口应该是没问题的,你可以用 chrome://inspect/#devices 调试看下有没有返回值。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/weidian-inc/hera/issues/22#issuecomment-354725614, or mute the thread https://github.com/notifications/unsubscribe-auth/AYk2ZSNzqbS7fTEQWhYG8Zna_m56X9ujks5tGfLggaJpZM4RQYN9.

嗯,找到问题了,应该是不支持 ‘wx.login()’的问题,但是如果我需要用到 wx.login 返回的 会话密钥(session_key),该怎么获取啊?

pgfxm commented 6 years ago

目前对wx.login接口的处理方式是自定义一个用于非微信环境使用的登录页面,你可以看一下hera网站文档的 其它-微信登录与跨域 这项,应该能帮上你,你可以加入我们群方便沟通