| 85 | .finally(() => $.done()); |
| 86 | |
| 87 | function checkin() { |
| 88 | const url = `https://appgw.huazhu.com/game/sign_in?date=${parseInt(Date.now() / 1000)}`; |
| 89 | const headers = { |
| 90 | Connection: "keep-alive", |
| 91 | "Accept-Encoding": "gzip, deflate, br", |
| 92 | "Client-Platform": "APP-IOS", |
| 93 | Origin: "https://cdn.huazhu.com", |
| 94 | "User-Agent": "HUAZHU/ios/iPhone/18.0/9.24.0/RNWEBVIEW", |
| 95 | Cookie: $.cookie, |
| 96 | Host: "appgw.huazhu.com", |
| 97 | Referer: "https://cdn.huazhu.com/", |
| 98 | "Accept-Language": "zh-CN,zh-Hans;q=0.9", |
| 99 | Accept: "application/json, text/plain, */*", |
| 100 | }; |
| 101 | const myRequest = { |
| 102 | url: url, |
| 103 | headers: headers |
| 104 | }; |
| 105 | return $.http.get(myRequest).then((response) => { |
| 106 | if (response.statusCode == 200) { |
| 107 | if (JSON.parse(response.body).message == "fail") { |
| 108 | throw new ERR.EventError("服务器返回数据错误,请重新获取Cookie"); |
| 109 | } else { |
| 110 | $.data = JSON.parse(response.body).content; |
| 111 | $.log($.data); |
| 112 | } |
| 113 | } else { |
| 114 | $.error(JSON.stringify(response)); |
| 115 | throw new ERR.ParseError("签到错误,请检查日志,稍后再试"); |
| 116 | } |
| 117 | }); |
| 118 | } |
| 119 | |
| 120 | function showmsg() { |
| 121 | if ($.data.signResult == true) { |