Module: ThirdPartyWxa::Api::Login
- Included in:
- Plugin
- Defined in:
- lib/third_party_wxa/api/login.rb
Instance Method Summary collapse
-
#jscode2session(options) ⇒ Object
code 换取 session_key get api.weixin.qq.com/sns/component/jscode2session?appid=APPID&js_code=JSCODE&grant_type=authorization_code&component_appid=COMPONENT_APPID&component_access_token=ACCESS_TOKEN support local store only now.
Instance Method Details
#jscode2session(options) ⇒ Object
code 换取 session_key get api.weixin.qq.com/sns/component/jscode2session?appid=APPID&js_code=JSCODE&grant_type=authorization_code&component_appid=COMPONENT_APPID&component_access_token=ACCESS_TOKEN support local store only now
8 9 10 11 12 13 14 15 |
# File 'lib/third_party_wxa/api/login.rb', line 8 def jscode2session params = { component_appid: appid, component_access_token: get_component_access_token, grant_type: 'authorization_code' }.merge!(.slice(:appid, :js_code)) ThirdPartyWxa.http_get_without_component_access_token 'sns', 'component/jscode2session', params end |