class Wechat::SNS::AuthorizeLink
Authorize Link 是授权链接类。用于生成授权链接。如: Wechat::SNS::AuthorizeLink.create
wechat_app_id, redirect_link
Constants
- RESPONSE_TYPE_CODE
- SCOPE_BASE
- SCOPE_FULL
Public Class Methods
create(wechat_app_id, redirect_link, response_type: Wechat::SNS::AuthorizeLink::RESPONSE_TYPE_CODE, scope: Wechat::SNS::AuthorizeLink::SCOPE_FULL, state: nil)
click to toggle source
# File lib/wechat/sns/authorize_link.rb, line 16 def self.create(wechat_app_id, redirect_link, response_type: Wechat::SNS::AuthorizeLink::RESPONSE_TYPE_CODE, scope: Wechat::SNS::AuthorizeLink::SCOPE_FULL, state: nil) assert_present! :wechat_app_id, wechat_app_id assert_present! :redirect_link, redirect_link assert_present! :response_type, response_type assert_present! :scope, scope "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{wechat_app_id}&redirect_uri=#{CGI::escape redirect_link}&response_type=#{response_type}&scope=#{scope}&state=#{state}#wechat_redirect" end