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
559b3626
Commit
559b3626
authored
Apr 09, 2014
by
lanrion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor storage
parent
cafe7f50
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lib/weixin_authorize/adapter/redis_storage.rb
+2
-2
lib/weixin_authorize/adapter/storage.rb
+2
-2
No files found.
lib/weixin_authorize/adapter/redis_storage.rb
View file @
559b3626
...
@@ -14,8 +14,8 @@ module WeixinAuthorize
...
@@ -14,8 +14,8 @@ module WeixinAuthorize
def
refresh_token
def
refresh_token
super
super
weixin_redis
.
hmset
(
client
.
redis_key
,
:access_token
,
client
.
access_token
,
weixin_redis
.
hmset
(
client
.
redis_key
,
"access_token"
,
client
.
access_token
,
:expired_at
,
client
.
expired_at
)
"expired_at"
,
client
.
expired_at
)
weixin_redis
.
expireat
(
client
.
redis_key
,
client
.
expired_at
.
to_i
-
10
)
# 提前10秒超时
weixin_redis
.
expireat
(
client
.
redis_key
,
client
.
expired_at
.
to_i
-
10
)
# 提前10秒超时
end
end
...
...
lib/weixin_authorize/adapter/storage.rb
View file @
559b3626
...
@@ -55,7 +55,7 @@ module WeixinAuthorize
...
@@ -55,7 +55,7 @@ module WeixinAuthorize
end
end
def
authenticate_headers
def
authenticate_headers
{
grant_type:
"client_credential"
,
appid:
client
.
app_id
,
secret:
client
.
app_secret
}
{
grant_type:
GRANT_TYPE
,
appid:
client
.
app_id
,
secret:
client
.
app_secret
}
end
end
private
private
...
@@ -64,7 +64,7 @@ module WeixinAuthorize
...
@@ -64,7 +64,7 @@ module WeixinAuthorize
auth_result
=
authenticate
auth_result
=
authenticate
if
!
auth_result
[
"valid"
]
if
!
auth_result
[
"valid"
]
result_handler
=
auth_result
[
"handler"
]
result_handler
=
auth_result
[
"handler"
]
raise
ValidAccessTokenException
,
"
#{
result_handler
.
code
}
:
#{
result_handler
.
en_msg
}
(
#{
result_handler
.
cn_msg
}
)"
raise
ValidAccessTokenException
,
result_handler
.
full_error_message
end
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