eric_weixin 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.idea/workspace.xml +33 -79
- data/eric_weixin.gemspec +0 -1
- data/lib/eric_weixin/app/controllers/weixin/weixin_controller.rb +7 -4
- data/lib/eric_weixin/app/views/eric_weixin/weixin/aa.erb +1 -1
- data/lib/eric_weixin/version.rb +1 -1
- data/lib/eric_weixin.rb +31 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71e30df53ea57b8653478a30c1b372acfe6cfd0d
|
4
|
+
data.tar.gz: fb343a19e2dc59e4f2f85c7641f93b78ae4012f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a29371faa84e186eef8cc9f8aa3095c916d89c7bb3dda275205d036f6c17cce7ea82c6c359e0c39705002702efae1591e27c514477633b375309ce58b3623926
|
7
|
+
data.tar.gz: ca2330aee0b3809223b7586c8e254e314dd1e7cff9e2bcac202d55e66437b6b104b6ae07493eac939b51fd6c58436ce5a037694a39a911fcb5ceac746d1e8a25
|
data/.gitignore
CHANGED
data/.idea/workspace.xml
CHANGED
@@ -2,11 +2,7 @@
|
|
2
2
|
<project version="4">
|
3
3
|
<component name="ChangeListManager">
|
4
4
|
<list default="true" id="825e533a-b0a1-462f-abd1-eefea8ff703f" name="Default" comment="">
|
5
|
-
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/eric_weixin
|
6
|
-
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/eric_weixin/app/model/public_account.rb" afterPath="$PROJECT_DIR$/lib/eric_weixin/app/model/public_account.rb" />
|
7
|
-
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/eric_weixin/version.rb" afterPath="$PROJECT_DIR$/lib/eric_weixin/version.rb" />
|
8
|
-
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/eric_weixin/app/controllers/weixin/weixin_controller.rb" afterPath="$PROJECT_DIR$/lib/eric_weixin/app/controllers/weixin/weixin_controller.rb" />
|
9
|
-
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/eric_weixin/app/model/weixin_user.rb" afterPath="$PROJECT_DIR$/lib/eric_weixin/app/model/weixin_user.rb" />
|
5
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/eric_weixin.rb" afterPath="$PROJECT_DIR$/lib/eric_weixin.rb" />
|
10
6
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
11
7
|
</list>
|
12
8
|
<ignored path="eric_weixin.iws" />
|
@@ -30,50 +26,20 @@
|
|
30
26
|
</component>
|
31
27
|
<component name="FileEditorManager">
|
32
28
|
<leaf>
|
33
|
-
<file leaf-file-name="
|
34
|
-
<entry file="file://$PROJECT_DIR$/lib/eric_weixin/app/controllers/weixin/weixin_controller.rb">
|
35
|
-
<provider selected="true" editor-type-id="text-editor">
|
36
|
-
<state vertical-scroll-proportion="0.0" vertical-offset="558" max-vertical-offset="774">
|
37
|
-
<caret line="31" column="7" selection-start-line="31" selection-start-column="7" selection-end-line="31" selection-end-column="7" />
|
38
|
-
<folding />
|
39
|
-
</state>
|
40
|
-
</provider>
|
41
|
-
</entry>
|
42
|
-
</file>
|
43
|
-
<file leaf-file-name="weixin_user.rb" pinned="false" current="false" current-in-tab="false">
|
44
|
-
<entry file="file://$PROJECT_DIR$/lib/eric_weixin/app/model/weixin_user.rb">
|
45
|
-
<provider selected="true" editor-type-id="text-editor">
|
46
|
-
<state vertical-scroll-proportion="0.0" vertical-offset="360" max-vertical-offset="1710">
|
47
|
-
<caret line="40" column="8" selection-start-line="40" selection-start-column="8" selection-end-line="40" selection-end-column="8" />
|
48
|
-
<folding />
|
49
|
-
</state>
|
50
|
-
</provider>
|
51
|
-
</entry>
|
52
|
-
</file>
|
53
|
-
<file leaf-file-name="public_account.rb" pinned="false" current="false" current-in-tab="false">
|
54
|
-
<entry file="file://$PROJECT_DIR$/lib/eric_weixin/app/model/public_account.rb">
|
55
|
-
<provider selected="true" editor-type-id="text-editor">
|
56
|
-
<state vertical-scroll-proportion="0.0" vertical-offset="21" max-vertical-offset="3438">
|
57
|
-
<caret line="32" column="11" selection-start-line="32" selection-start-column="11" selection-end-line="32" selection-end-column="11" />
|
58
|
-
<folding />
|
59
|
-
</state>
|
60
|
-
</provider>
|
61
|
-
</entry>
|
62
|
-
</file>
|
63
|
-
<file leaf-file-name="eric_weixin.gemspec" pinned="false" current="true" current-in-tab="true">
|
29
|
+
<file leaf-file-name="eric_weixin.gemspec" pinned="false" current="false" current-in-tab="false">
|
64
30
|
<entry file="file://$PROJECT_DIR$/eric_weixin.gemspec">
|
65
31
|
<provider selected="true" editor-type-id="text-editor">
|
66
|
-
<state vertical-scroll-proportion="0.
|
67
|
-
<caret line="
|
32
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="684">
|
33
|
+
<caret line="28" column="68" selection-start-line="28" selection-start-column="68" selection-end-line="28" selection-end-column="68" />
|
68
34
|
<folding />
|
69
35
|
</state>
|
70
36
|
</provider>
|
71
37
|
</entry>
|
72
38
|
</file>
|
73
|
-
<file leaf-file-name="version.rb" pinned="false" current="
|
39
|
+
<file leaf-file-name="version.rb" pinned="false" current="true" current-in-tab="true">
|
74
40
|
<entry file="file://$PROJECT_DIR$/lib/eric_weixin/version.rb">
|
75
41
|
<provider selected="true" editor-type-id="text-editor">
|
76
|
-
<state vertical-scroll-proportion="0.
|
42
|
+
<state vertical-scroll-proportion="0.02549575" vertical-offset="0" max-vertical-offset="706">
|
77
43
|
<caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
78
44
|
<folding />
|
79
45
|
</state>
|
@@ -83,28 +49,8 @@
|
|
83
49
|
<file leaf-file-name="eric_weixin.rb" pinned="false" current="false" current-in-tab="false">
|
84
50
|
<entry file="file://$PROJECT_DIR$/lib/eric_weixin.rb">
|
85
51
|
<provider selected="true" editor-type-id="text-editor">
|
86
|
-
<state vertical-scroll-proportion="0.0" vertical-offset="
|
87
|
-
<caret line="18" column="
|
88
|
-
<folding />
|
89
|
-
</state>
|
90
|
-
</provider>
|
91
|
-
</entry>
|
92
|
-
</file>
|
93
|
-
<file leaf-file-name="Gemfile" pinned="false" current="false" current-in-tab="false">
|
94
|
-
<entry file="file://$PROJECT_DIR$/Gemfile">
|
95
|
-
<provider selected="true" editor-type-id="text-editor">
|
96
|
-
<state vertical-scroll-proportion="0.0" vertical-offset="72" max-vertical-offset="180">
|
97
|
-
<caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
|
98
|
-
<folding />
|
99
|
-
</state>
|
100
|
-
</provider>
|
101
|
-
</entry>
|
102
|
-
</file>
|
103
|
-
<file leaf-file-name="aa.erb" pinned="false" current="false" current-in-tab="false">
|
104
|
-
<entry file="file://$PROJECT_DIR$/lib/eric_weixin/app/views/eric_weixin/weixin/aa.erb">
|
105
|
-
<provider selected="true" editor-type-id="text-editor">
|
106
|
-
<state vertical-scroll-proportion="0.0" vertical-offset="18" max-vertical-offset="126">
|
107
|
-
<caret line="1" column="17" selection-start-line="1" selection-start-column="17" selection-end-line="1" selection-end-column="17" />
|
52
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="279" max-vertical-offset="972">
|
53
|
+
<caret line="18" column="2" selection-start-line="18" selection-start-column="2" selection-end-line="18" selection-end-column="2" />
|
108
54
|
<folding />
|
109
55
|
</state>
|
110
56
|
</provider>
|
@@ -134,14 +80,14 @@
|
|
134
80
|
<option value="$PROJECT_DIR$/lib/eric_weixin/app/model/article_news.rb" />
|
135
81
|
<option value="$PROJECT_DIR$/lib/eric_weixin/app/controllers/weixin/base_controller.rb" />
|
136
82
|
<option value="$PROJECT_DIR$/lib/eric_weixin/app/views/weixin/aa.erb" />
|
137
|
-
<option value="$PROJECT_DIR$/eric_weixin.gemspec" />
|
138
83
|
<option value="$PROJECT_DIR$/lib/eric_weixin/app/controllers/big_application_controller.rb" />
|
139
|
-
<option value="$PROJECT_DIR$/lib/eric_weixin.rb" />
|
140
84
|
<option value="$PROJECT_DIR$/lib/eric_weixin/app/model/reply_message_rule.rb" />
|
141
85
|
<option value="$PROJECT_DIR$/lib/eric_weixin/app/views/eric_weixin/weixin/aa.erb" />
|
142
86
|
<option value="$PROJECT_DIR$/lib/eric_weixin/app/controllers/weixin/weixin_controller.rb" />
|
143
87
|
<option value="$PROJECT_DIR$/lib/eric_weixin/app/model/public_account.rb" />
|
144
88
|
<option value="$PROJECT_DIR$/lib/eric_weixin/app/model/weixin_user.rb" />
|
89
|
+
<option value="$PROJECT_DIR$/eric_weixin.gemspec" />
|
90
|
+
<option value="$PROJECT_DIR$/lib/eric_weixin.rb" />
|
145
91
|
<option value="$PROJECT_DIR$/lib/eric_weixin/version.rb" />
|
146
92
|
</list>
|
147
93
|
</option>
|
@@ -441,7 +387,7 @@
|
|
441
387
|
<servers />
|
442
388
|
</component>
|
443
389
|
<component name="ToolWindowManager">
|
444
|
-
<frame x="0" y="23" width="1440" height="829" extended-state="
|
390
|
+
<frame x="0" y="23" width="1440" height="829" extended-state="0" />
|
445
391
|
<editor active="true" />
|
446
392
|
<layout>
|
447
393
|
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
@@ -449,7 +395,7 @@
|
|
449
395
|
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
450
396
|
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
451
397
|
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
452
|
-
<window_info id="Project" active="
|
398
|
+
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25178826" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
453
399
|
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
454
400
|
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
455
401
|
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="true" content_ui="tabs" />
|
@@ -457,11 +403,11 @@
|
|
457
403
|
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
|
458
404
|
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
459
405
|
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
460
|
-
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
461
406
|
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.42098093" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
407
|
+
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
462
408
|
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
463
|
-
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
464
409
|
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
410
|
+
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
465
411
|
</layout>
|
466
412
|
</component>
|
467
413
|
<component name="Vcs.Log.UiProperties">
|
@@ -484,6 +430,14 @@
|
|
484
430
|
<breakpoint-manager />
|
485
431
|
</component>
|
486
432
|
<component name="editorHistoryManager">
|
433
|
+
<entry file="file://$PROJECT_DIR$/eric_weixin.gemspec">
|
434
|
+
<provider selected="true" editor-type-id="text-editor">
|
435
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="504" max-vertical-offset="684">
|
436
|
+
<caret line="28" column="68" selection-start-line="28" selection-start-column="68" selection-end-line="28" selection-end-column="68" />
|
437
|
+
<folding />
|
438
|
+
</state>
|
439
|
+
</provider>
|
440
|
+
</entry>
|
487
441
|
<entry file="file://$PROJECT_DIR$/lib/eric_weixin/app/controllers/weixin/weixin_controller.rb">
|
488
442
|
<provider selected="true" editor-type-id="text-editor">
|
489
443
|
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="774">
|
@@ -734,14 +688,14 @@
|
|
734
688
|
</provider>
|
735
689
|
</entry>
|
736
690
|
<entry file="file://$PROJECT_DIR$/LICENSE.txt">
|
737
|
-
<provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider">
|
738
|
-
<state />
|
739
|
-
</provider>
|
740
691
|
<provider selected="true" editor-type-id="text-editor">
|
741
692
|
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="680">
|
742
693
|
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
743
694
|
</state>
|
744
695
|
</provider>
|
696
|
+
<provider editor-type-id="com.intellij.persistence.database.editor.CsvTableFileEditorProvider">
|
697
|
+
<state />
|
698
|
+
</provider>
|
745
699
|
</entry>
|
746
700
|
<entry file="file://$PROJECT_DIR$/Rakefile">
|
747
701
|
<provider selected="true" editor-type-id="text-editor">
|
@@ -840,26 +794,26 @@
|
|
840
794
|
</state>
|
841
795
|
</provider>
|
842
796
|
</entry>
|
843
|
-
<entry file="file://$PROJECT_DIR$/
|
797
|
+
<entry file="file://$PROJECT_DIR$/eric_weixin.gemspec">
|
844
798
|
<provider selected="true" editor-type-id="text-editor">
|
845
|
-
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="
|
846
|
-
<caret line="
|
799
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="684">
|
800
|
+
<caret line="28" column="68" selection-start-line="28" selection-start-column="68" selection-end-line="28" selection-end-column="68" />
|
847
801
|
<folding />
|
848
802
|
</state>
|
849
803
|
</provider>
|
850
804
|
</entry>
|
851
805
|
<entry file="file://$PROJECT_DIR$/lib/eric_weixin.rb">
|
852
806
|
<provider selected="true" editor-type-id="text-editor">
|
853
|
-
<state vertical-scroll-proportion="0.0" vertical-offset="
|
854
|
-
<caret line="18" column="
|
807
|
+
<state vertical-scroll-proportion="0.0" vertical-offset="279" max-vertical-offset="972">
|
808
|
+
<caret line="18" column="2" selection-start-line="18" selection-start-column="2" selection-end-line="18" selection-end-column="2" />
|
855
809
|
<folding />
|
856
810
|
</state>
|
857
811
|
</provider>
|
858
812
|
</entry>
|
859
|
-
<entry file="file://$PROJECT_DIR$/eric_weixin.
|
813
|
+
<entry file="file://$PROJECT_DIR$/lib/eric_weixin/version.rb">
|
860
814
|
<provider selected="true" editor-type-id="text-editor">
|
861
|
-
<state vertical-scroll-proportion="0.
|
862
|
-
<caret line="
|
815
|
+
<state vertical-scroll-proportion="0.02549575" vertical-offset="0" max-vertical-offset="706">
|
816
|
+
<caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
863
817
|
<folding />
|
864
818
|
</state>
|
865
819
|
</provider>
|
data/eric_weixin.gemspec
CHANGED
@@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency 'actionpack', '~> 4.1', '>= 4.1.4'
|
28
28
|
spec.add_development_dependency 'activesupport', '~> 4.1', '>= 4.1.4'
|
29
29
|
spec.add_development_dependency 'actionview', '~> 4.1', '>= 4.1.4'
|
30
|
-
|
31
30
|
spec.add_development_dependency 'eric_tools', '~> 0.0.4'
|
32
31
|
|
33
32
|
end
|
@@ -20,10 +20,15 @@ module EricWeixin
|
|
20
20
|
|
21
21
|
def snsapi_api
|
22
22
|
require "base64"
|
23
|
-
weixin_public_account = EricWeixin::PublicAccount.where(
|
23
|
+
weixin_public_account = EricWeixin::PublicAccount.where(weixin_app_id: params["weixin_app_id"]).first
|
24
24
|
response = RestClient.get "https://api.weixin.qq.com/sns/oauth2/access_token?appid=#{weixin_public_account.weixin_app_id}&secret=#{weixin_public_account.weixin_secret_key}&code=#{params[:code]}&grant_type=authorization_code"
|
25
25
|
result_hash = JSON.parse(response.body)
|
26
|
-
|
26
|
+
u = URI(Base64.decode64(params["url"]))
|
27
|
+
p = URI.decode_www_form u.query||''
|
28
|
+
p << ["openid", result_hash['openid']]
|
29
|
+
p << ["state", params["state"]]
|
30
|
+
p = URI.encode_www_form p
|
31
|
+
url = [u.to_s.split('?')[0], p].join '?'
|
27
32
|
redirect_to url
|
28
33
|
end
|
29
34
|
|
@@ -31,7 +36,5 @@ module EricWeixin
|
|
31
36
|
@ee = 12
|
32
37
|
end
|
33
38
|
|
34
|
-
|
35
|
-
|
36
39
|
end
|
37
40
|
end
|
@@ -1,2 +1,2 @@
|
|
1
|
-
<%=@ee
|
1
|
+
<%=@ee%><br/>
|
2
2
|
<%=params[:openid]%>
|
data/lib/eric_weixin/version.rb
CHANGED
data/lib/eric_weixin.rb
CHANGED
@@ -8,12 +8,41 @@ require File.dirname(__FILE__) + '/eric_weixin/app/model/public_account.rb'
|
|
8
8
|
require File.dirname(__FILE__) + '/eric_weixin/app/model/reply_message_rule.rb'
|
9
9
|
require File.dirname(__FILE__) + '/eric_weixin/app/model/weixin_user.rb'
|
10
10
|
require File.dirname(__FILE__) + '/eric_weixin/reply_message.rb'
|
11
|
-
|
12
|
-
|
13
11
|
require File.dirname(__FILE__) + '/eric_weixin/app/controllers/weixin/weixin_controller'
|
14
12
|
|
15
13
|
|
16
14
|
module EricWeixin
|
17
15
|
# 把gem目录放作为视图目录
|
18
16
|
ActionController::Base.append_view_path(File.dirname(__FILE__) + '/eric_weixin/app/views')
|
17
|
+
|
18
|
+
#获取重定向的URI
|
19
|
+
#参数1: url #业务URL,即最终需要跳转到的url,域名中的主机名称可选,可以写 'www.baidu.com/xxx', 也可以写 '/xxx'。 这里主要用于重定向。
|
20
|
+
#参数2: app_id #公众账号app_id
|
21
|
+
#参数3: schema_host 当前项目的域名(包含http://):如http://www.baidu.com
|
22
|
+
#可选参数4: state
|
23
|
+
#示例:get_snsapi_uri url:'/weixin/service1/ddd?a=1', app_id: 'wx4564afc37fac0ebf', schema_host: "http://lxq.mdcc.com"
|
24
|
+
def get_snsapi_url options
|
25
|
+
require 'base64'
|
26
|
+
p_zhongzhuan = []
|
27
|
+
p_zhongzhuan_host_path = "#{options[:schema_host]}/weixin/snsapi"
|
28
|
+
p_zhongzhuan << ["weixin_app_id", options[:app_id]]
|
29
|
+
p_zhongzhuan << ["url", Base64.encode64(options[:url])]
|
30
|
+
p_zhongzhuan = URI.encode_www_form p_zhongzhuan
|
31
|
+
p_zhongzhuan = CGI::unescape p_zhongzhuan
|
32
|
+
p_zhongzhuan_url = [p_zhongzhuan_host_path, p_zhongzhuan].join('?')
|
33
|
+
|
34
|
+
p_host_and_path = 'https://open.weixin.qq.com/connect/oauth2/authorize'
|
35
|
+
p = []
|
36
|
+
p << ['appid', options[:app_id]]
|
37
|
+
p << ["redirect_uri", CGI::escape(p_zhongzhuan_url)]
|
38
|
+
p << ['response_type', 'code']
|
39
|
+
p << ['scope', 'snsapi_base']
|
40
|
+
p << ['state', "#{options[:state]||'abc'}"]
|
41
|
+
p = URI.encode_www_form p
|
42
|
+
p = CGI::unescape p
|
43
|
+
p_url = [p_host_and_path, "#{p}#wechat_redirect"].join '?'
|
44
|
+
p_url
|
45
|
+
end
|
46
|
+
|
47
|
+
|
19
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eric_weixin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 刘晓琦
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|