third_party_wxa 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/third_party_wxa.rb +3 -0
- data/lib/third_party_wxa/api/authorize.rb +8 -2
- data/lib/third_party_wxa/plugin.rb +4 -4
- data/lib/third_party_wxa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5eb92c75b2a2bf102ae7ab81b7cd07f99dcf162bb382813f016e571c82183fe9
|
4
|
+
data.tar.gz: cac2c579e2357f902f05d26cd33d359088554e9407470816f345b54ebc363158
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09b9b975ec674bac689999841759bc7a41cc368b00472e5b419c07db38d58e4f7e65bbdcb6b359585835a8379b20adc95b8212db6f4af2f97ed925b38d7f446b'
|
7
|
+
data.tar.gz: 3cb7fceca643698b96e2e2f6e3769539d80a02486b9bd15401e0998c53c7c981dca66b497528c5be203609ada12c05ca7bf930dbe8193501035ca0e015d19479
|
data/Gemfile.lock
CHANGED
data/lib/third_party_wxa.rb
CHANGED
@@ -18,6 +18,7 @@ module ThirdPartyWxa
|
|
18
18
|
class << self
|
19
19
|
def http_get_without_component_access_token scope, url, url_params={}
|
20
20
|
url = "#{BASE}#{scope}/#{url}"
|
21
|
+
p "get ----- #{url}"
|
21
22
|
JSON.parse RestClient.get URI.encode(url), {params: url_params}
|
22
23
|
end
|
23
24
|
|
@@ -26,6 +27,8 @@ module ThirdPartyWxa
|
|
26
27
|
url = "#{BASE}#{scope}/#{url}"
|
27
28
|
param = url_params.to_param
|
28
29
|
url += "?#{param}" if !param.blank?
|
30
|
+
p "post ----- #{url}"
|
31
|
+
p post_params
|
29
32
|
JSON.parse RestClient.post URI.encode(url), post_params.to_json
|
30
33
|
end
|
31
34
|
|
@@ -13,7 +13,10 @@ module ThirdPartyWxa
|
|
13
13
|
|
14
14
|
def authorizer_access_token_api(auth_code)
|
15
15
|
params = {component_appid: appid, authorization_code: auth_code}
|
16
|
-
ThirdPartyWxa.http_post_without_component_access_token 'cgi-bin',
|
16
|
+
ThirdPartyWxa.http_post_without_component_access_token 'cgi-bin',
|
17
|
+
'component/api_query_auth',
|
18
|
+
params,
|
19
|
+
{component_access_token: get_component_access_token}
|
17
20
|
end
|
18
21
|
|
19
22
|
#https:// api.weixin.qq.com /cgi-bin/component/api_authorizer_token?component_access_token=xxxxx
|
@@ -24,7 +27,10 @@ module ThirdPartyWxa
|
|
24
27
|
"authorizer_appid": auth_appid,
|
25
28
|
"authorizer_refresh_token": refresh_token,
|
26
29
|
}
|
27
|
-
|
30
|
+
ThirdPartyWxa.http_post_without_component_access_token 'cgi-bin',
|
31
|
+
'component/api_authorizer_token',
|
32
|
+
params,
|
33
|
+
{component_access_token: get_component_access_token}
|
28
34
|
end
|
29
35
|
|
30
36
|
|
@@ -12,13 +12,13 @@ module ThirdPartyWxa
|
|
12
12
|
attr_accessor :component_verify_ticket, :ticket_expire_at
|
13
13
|
attr_accessor :component_access_token, :component_expire_at #2小时
|
14
14
|
attr_accessor :pre_auth_code, :pre_expire_at #10分钟
|
15
|
-
|
16
|
-
# attr_accessor :authorizer_access_token, :authorizer_refresh_token, :authorizer_expire_at
|
17
|
-
# attr_accessor :authorizer
|
15
|
+
attr_accessor :token_store
|
18
16
|
|
19
17
|
def initialize
|
20
18
|
@appid = ThirdPartyWxa.appid
|
21
19
|
@appsecret = ThirdPartyWxa.appsecret
|
20
|
+
@token_store = token_store_init
|
21
|
+
p "third party wxa use #{@token_store.class.to_s}"
|
22
22
|
end
|
23
23
|
|
24
24
|
def set_tickect ticket, expire_in
|
@@ -61,7 +61,7 @@ module ThirdPartyWxa
|
|
61
61
|
self
|
62
62
|
end
|
63
63
|
|
64
|
-
def
|
64
|
+
def token_store_init
|
65
65
|
Token::Store.init_with(self)
|
66
66
|
end
|
67
67
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: third_party_wxa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hzy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|