fastlane-plugin-pgyer_jvtd 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e391277612610b620b9aa65c369dd8b8c63e31485657ba6f143cb79286ec1c5
|
4
|
+
data.tar.gz: 17de902acee5e255f646a32d4c45922d227aca083a880bf087615074c98534e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db02089e67674cb4ce5b7227c3721ed2777397ab6c82910f8fddc875daabaed53215c1363d1459ed1e6cb854fa851899e54c3b60e45e89c000c2c38f5aab1eff
|
7
|
+
data.tar.gz: 88ad77f3f572181ecfba2ba13a63ea6b88b2a9326bc543fbbb165773a8b8403260c1ae03b5ebce88fe4180a58f4d60d98d6761422a5cbdbe00147c64e484eece
|
@@ -103,46 +103,60 @@ module Fastlane
|
|
103
103
|
appUrl = "https://www.pgyer.com/#{info['data']['appShortcutUrl']}"
|
104
104
|
|
105
105
|
unless access_token.nil?
|
106
|
-
|
107
|
-
uri = URI.parse("https://oapi.dingtalk.com/robot/send?access_token=#{access_token}")
|
108
|
-
https = Net::HTTP.new(uri.host, uri.port)
|
109
|
-
https.use_ssl = true
|
110
|
-
req = Net::HTTP::Post.new(uri.request_uri)
|
111
|
-
req.body = {
|
112
|
-
"msgtype"=> "link",
|
113
|
-
"link"=> {
|
114
|
-
"text"=> "#{appName}#{appType} App发布",
|
115
|
-
"title"=> "请下载最新版本#{appVersion}(#{appBuildVersion})",
|
116
|
-
"picUrl"=> appIcon,
|
117
|
-
"messageUrl"=> appUrl}
|
118
|
-
}.to_json
|
119
|
-
req.content_type = 'application/json'
|
120
|
-
resp = https.request(req)
|
121
|
-
json = JSON.parse(resp.body)
|
106
|
+
uri = URI.parse("https://oapi.dingtalk.com/robot/send?access_token=#{access_token}")
|
122
107
|
|
123
|
-
|
124
|
-
|
125
|
-
|
108
|
+
dingtalk_client = Faraday.new(nil, conn_options) do |c|
|
109
|
+
c.request :multipart
|
110
|
+
c.request :url_encoded
|
111
|
+
c.response :json, content_type: /\bjson$/
|
112
|
+
c.adapter :net_http
|
113
|
+
end
|
114
|
+
|
115
|
+
params = {
|
116
|
+
"msgtype"=> "link",
|
117
|
+
"link"=> {
|
118
|
+
"text"=> "#{appName}#{appType} App发布",
|
119
|
+
"title"=> "请下载最新版本#{appVersion}(#{appBuildVersion})",
|
120
|
+
"picUrl"=> appIcon,
|
121
|
+
"messageUrl"=> appUrl
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
|
126
|
+
response = dingtalk_client.post uri, params
|
127
|
+
info = response.body
|
128
|
+
|
129
|
+
if info['errcode'] != 0
|
130
|
+
UI.error('ding talk error message: ' + info["errmsg"])
|
131
|
+
end
|
126
132
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
}
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
133
|
+
dingtalk2_client = Faraday.new(nil, conn_options) do |c|
|
134
|
+
c.request :multipart
|
135
|
+
c.request :url_encoded
|
136
|
+
c.response :json, content_type: /\bjson$/
|
137
|
+
c.adapter :net_http
|
138
|
+
end
|
139
|
+
|
140
|
+
params = {
|
141
|
+
"msgtype" => "text",
|
142
|
+
"text" => {
|
143
|
+
"content" => "#{appName}#{appType} App最新版本已发布"
|
144
|
+
},
|
145
|
+
"at"=> {
|
146
|
+
"atMobiles" => [],
|
147
|
+
"isAtAll" => ia_at_all == "1"
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
|
152
|
+
response = dingtalk2_client.post uri, params
|
153
|
+
info = response.body
|
154
|
+
|
155
|
+
if info['errcode'] != 0
|
156
|
+
UI.error('ding talk error message: ' + info["errmsg"])
|
157
|
+
end
|
158
|
+
|
159
|
+
UI.success("Successfully send qr code to ding talk!")
|
146
160
|
else
|
147
161
|
end
|
148
162
|
|