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
1ab28bb9
Commit
1ab28bb9
authored
Mar 16, 2014
by
lanrion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated client.rb
parent
b6f3cf92
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
lib/weixin_authorize/client.rb
+6
-2
No files found.
lib/weixin_authorize/client.rb
View file @
1ab28bb9
...
...
@@ -3,12 +3,12 @@
module
WeixinAuthorize
class
Client
attr_accessor
:app_id
,
:app_secret
,
:expired_at
# Time.now + expires_in
include
Api
::
User
include
Api
::
Menu
include
Api
::
Custom
include
Api
::
Groups
attr_accessor
:app_id
,
:app_secret
,
:expired_at
# Time.now + expires_in
attr_accessor
:access_token
def
initialize
(
app_id
=
""
,
app_secret
=
""
,
expired_at
=
nil
)
...
...
@@ -21,7 +21,7 @@ module WeixinAuthorize
# return token
def
get_access_token
# 如果当前token过期时间小于现在的时间,则重新获取一次
if
@expired_at
<
Time
.
now
.
to_i
if
@expired_at
<
=
Time
.
now
.
to_i
authenticate
end
@access_token
...
...
@@ -44,5 +44,9 @@ module WeixinAuthorize
"https://api.weixin.qq.com/cgi-bin"
end
def
access_token_param
"access_token=
#{
get_access_token
}
"
end
end
end
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