MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / getSignStatus

Method getSignStatus

daily/yingsheng.js:172–200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170 }
171
172 async getSignStatus() {
173 try {
174 let param = { 'date': '' }
175 let url = `https://yingsheng.elecfans.com/ysapi/wapi/activity/signin/data?${$.jsonToStr(param, '&')}`
176 let headersParams = this.calculateSign(param, 'yingsheng')
177 let options = {
178 method: 'get',
179 url,
180 headers: {
181 ...headersParams,
182 "User-Agent": defaultUserAgent,
183 },
184 }
185 let { data: result } = await axios.request(options)
186 if (result.code == 0) {
187 if (result.data.data.today_is_sign == 1) {
188 console.log(`今日已签到`)
189 } else {
190 console.log(`今日未签到`)
191 await $.wait(this.TASK_WAIT_TIME);
192 await this.signin();
193 }
194 } else {
195 console.log(`查询签到状态失败: ${result.message}`)
196 }
197 } catch (e) {
198 console.log(e)
199 }
200 }
201
202 async signin() {
203 try {

Callers 1

runMethod · 0.95

Calls 6

calculateSignMethod · 0.95
signinMethod · 0.95
jsonToStrMethod · 0.80
requestMethod · 0.45
logMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected