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
26ca43fe
Commit
26ca43fe
authored
Apr 26, 2015
by
lanrion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加永久的字符串二维码生成
parent
fe42ad29
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
lib/weixin_authorize/api/qrcode.rb
+13
-2
No files found.
lib/weixin_authorize/api/qrcode.rb
View file @
26ca43fe
...
...
@@ -19,10 +19,21 @@ module WeixinAuthorize
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
,
scene_str
))
qrcode_infos
=
qrcode_infos
.
merge
(
action_info
(
scene_id
))
http_post
(
post_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
)
end
# 通过ticket换取二维码, 直接访问即可显示!
def
qr_code_url
(
ticket
)
WeixinAuthorize
.
mp_endpoint
(
"/showqrcode?ticket=
#{
ticket
}
"
)
...
...
@@ -36,7 +47,7 @@ module WeixinAuthorize
def
action_info
(
scene_id
,
scene_str
=
nil
)
scene_info
=
{}
scene_info
[
:scene_id
]
=
scene_id
scene_info
[
:scene_id
]
=
scene_id
if
!
scene_id
.
nil?
scene_info
[
:scene_str
]
=
scene_str
if
!
scene_str
.
nil?
{
action_info:
{
scene:
scene_info
}}
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