Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weixin_authorize
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
weixin_authorize
Commits
2f9295f7
Commit
2f9295f7
authored
Jul 17, 2014
by
lanrion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated oauth api
parent
712de9f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lib/weixin_authorize/api/oauth.rb
+2
-2
No files found.
lib/weixin_authorize/api/oauth.rb
View file @
2f9295f7
...
...
@@ -25,12 +25,12 @@ module WeixinAuthorize
# refresh_token: 填写通过access_token获取到的refresh_token参数
def
refresh_oauth2_token
(
refresh_token
)
WeixinAuthorize
.
http_get_without_token
(
"/sns/oauth2/refresh_token?appid=
#{
app_id
}
&grant_type=refresh_token&refresh_token=
#{
refresh_token
}
"
)
WeixinAuthorize
.
http_get_without_token
(
"/sns/oauth2/refresh_token?appid=
#{
app_id
}
&grant_type=refresh_token&refresh_token=
#{
refresh_token
}
"
,
{},
"api"
)
end
# 如果网页授权作用域为snsapi_userinfo,则此时开发者可以通过access_token和openid拉取用户信息了。
def
get_oauth_userinfo
(
openid
,
oauth_token
,
lang
=
"zh_CN"
)
WeixinAuthorize
.
http_get_without_token
(
"/sns/userinfo?access_token=
#{
oauth_token
}
&openid=
#{
openid
}
&lang=
#{
lang
}
"
)
WeixinAuthorize
.
http_get_without_token
(
"/sns/userinfo?access_token=
#{
oauth_token
}
&openid=
#{
openid
}
&lang=
#{
lang
}
"
,
{},
"api"
)
end
private
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment