MCPcopy Create free account
hub / github.com/ClydeTime/Surge / GetReword

Function GetReword

Script/Task/ADrive.js:158–203  ·  view source on GitHub ↗
(authorization, signInCount)

Source from the content-addressed store, hash-verified

156}
157
158function GetReword(authorization, signInCount) {
159 $.log('开始自动领取奖励')
160 const date = new Date()
161 let timeStamp = Date.parse(date)
162 let messageTitle, message
163 let xumt = 'defaultFY1_fyjs_not_loaded@@https://pages.aliyundrive.com/mobile-page/web/dailycheck.html@@' + timeStamp
164 let url_fetch_reword = {
165 url: 'https://member.aliyundrive.com/v1/activity/sign_in_reward?_rx-s=mobile',
166 headers: {
167 'Content-Type': 'application/json',
168 'accept': 'application/json, text/plain, */*',
169 Authorization: authorization,
170 'x-canary': ADriveInfo.headers['x-canary'],
171 'x-umt': xumt,
172 'origin': 'https://pages.aliyundrive.com',
173 'x-ua': xumt,
174 'user-agent': ADriveInfo.headers['user-agent'],
175 'referer': 'https://pages.aliyundrive.com/'
176 },
177 body: $.toStr({
178 "signInDay": signInCount
179 })
180 }
181 $.post(url_fetch_reword, function (error, response, data) {
182 if (error || !data) {
183 $.log('错误:' + error)
184 messageTitle = '❌自动领取奖励失败'
185 message = '自动领取奖励失败,请手动领取'
186 } else {
187 let body = $.toObj(data)
188 if (!body.success) {
189 $.log('❌自动领取奖励失败')
190 messageTitle = '❌自动领取奖励失败'
191 message = '自动领取奖励失败,请手动领取'
192 } else {
193 const rewordName = body.result.name
194 const rewordDescription = body.result.description
195 messageTitle = '签到成功!已自动领取奖励!'
196 message = '获得 ' + rewordDescription
197 $.log('自动领取奖励成功,获得 ' + rewordName + rewordDescription)
198 }
199 }
200 $.msg($.name, '签到成功!已自动领取奖励!', message)
201 $.done()
202 })
203}
204
205/***************** Env *****************/
206// prettier-ignore

Callers 1

signCheckinFunction · 0.85

Calls 7

logMethod · 0.45
parseMethod · 0.45
toStrMethod · 0.45
postMethod · 0.45
toObjMethod · 0.45
msgMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected