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
f5edbef5
Commit
f5edbef5
authored
Jun 23, 2015
by
lanrion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构生成二维码接口
parent
9117933a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
lib/weixin_authorize/api/qrcode.rb
+7
-11
No files found.
lib/weixin_authorize/api/qrcode.rb
View file @
f5edbef5
...
...
@@ -6,31 +6,27 @@ module WeixinAuthorize
# 临时二维码
def
create_qr_scene
(
scene_id
,
expire_seconds
=
1800
)
post_url
=
"
#{
qrcode_base_url
}
/create"
qrcode_infos
=
{
action_name:
"QR_SCENE"
,
expire_seconds:
expire_seconds
}
qrcode_infos
=
qrcode_infos
.
merge
(
action_info
(
scene_id
))
http_post
(
post
_url
,
qrcode_infos
)
qrcode_infos
.
merge!
(
action_info
(
scene_id
))
http_post
(
qrcode_base
_url
,
qrcode_infos
)
end
# 永久二维码
# options: scene_id, scene_str
def
create_qr_limit_scene
(
options
)
scene_id
=
options
[
:scene_id
]
scene_str
=
options
[
:scene_str
]
post_url
=
"
#{
qrcode_base_url
}
/create"
qrcode_infos
=
{
action_name:
"QR_LIMIT_SCENE"
}
qrcode_infos
=
qrcode_infos
.
merge
(
action_info
(
scene_id
))
http_post
(
post
_url
,
qrcode_infos
)
qrcode_infos
.
merge!
(
action_info
(
scene_id
))
http_post
(
qrcode_base
_url
,
qrcode_infos
)
end
# 为永久的字符串参数值
# options: scene_str
def
create_qr_limit_str_scene
(
options
)
scene_str
=
options
[
:scene_str
]
post_url
=
"
#{
qrcode_base_url
}
/create"
qrcode_infos
=
{
action_name:
"QR_LIMIT_STR_SCENE"
}
qrcode_infos
=
qrcode_infos
.
merge
(
action_info
(
nil
,
scene_str
))
http_post
(
post
_url
,
qrcode_infos
)
qrcode_infos
.
merge!
(
action_info
(
nil
,
scene_str
))
http_post
(
qrcode_base
_url
,
qrcode_infos
)
end
...
...
@@ -42,7 +38,7 @@ module WeixinAuthorize
private
def
qrcode_base_url
"/qrcode"
"/qrcode
/create
"
end
def
action_info
(
scene_id
,
scene_str
=
nil
)
...
...
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