wx.login获取openid
想要在小程序一起动的时候就获取openid,然后调用wx.login方法获取code,然后传入服务器在获取openID,在模拟器和调试环境中都是没问题的,一到正式环境就提示:

下面贴出我的代码:
小程序端代码:

服务器端代码:

配置参数:
其中KFAPPID和KFAPPSECRET是小程序的配置信息,code是传过来的,
getSessionKey参数是url,为https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code
百思不得其解,求官方给个提示。