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
597308a8
Commit
597308a8
authored
Mar 31, 2014
by
lanrion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor
parent
9432c4cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
lib/weixin_authorize.rb
+4
-4
lib/weixin_authorize/client.rb
+1
-1
No files found.
lib/weixin_authorize.rb
View file @
597308a8
...
...
@@ -11,18 +11,18 @@ module WeixinAuthorize
def
http_get_without_token
(
url
,
headers
=
{},
endpoint
=
"plain"
)
get_api_url
=
endpoint_url
(
endpoint
,
url
)
json_parse
(
RestClient
.
get
(
get_api_url
,
:params
=>
headers
))
load_json
(
RestClient
.
get
(
get_api_url
,
:params
=>
headers
))
end
def
http_post_without_token
(
url
,
payload
=
{},
headers
=
{},
endpoint
=
"plain"
)
post_api_url
=
endpoint_url
(
endpoint
,
url
)
payload
=
MultiJson
.
dump
(
payload
)
if
endpoint
==
"plain"
# to json
json_parse
(
RestClient
.
post
(
post_api_url
,
payload
,
headers
))
load_json
(
RestClient
.
post
(
post_api_url
,
payload
,
headers
))
end
# return hash
def
json_parse
(
json
)
JSON
.
parse
(
json
)
def
load_json
(
string
)
JSON
.
parse
(
string
)
end
def
endpoint_url
(
endpoint
,
url
)
...
...
lib/weixin_authorize/client.rb
View file @
597308a8
# encoding: utf-8
require
"redis"
require
'digest'
require
'digest
/md5
'
module
WeixinAuthorize
class
Client
...
...
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