()
| 209 | |
| 210 | // 领取奖励 |
| 211 | async function getGift() { |
| 212 | let opt = { |
| 213 | url: `https://yunbusiness.ccb.com/clp_coupon/txCtrl?txcode=A3341C120`, |
| 214 | headers: { |
| 215 | "MID": $.info?.MID, |
| 216 | "Content-Type": "application/json;charset=utf-8", |
| 217 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148/CloudMercWebView/UnionPay/1.0 CCBLoongPay", |
| 218 | "Accept": "application/json,text/javascript,*/*" |
| 219 | }, |
| 220 | body: `{"mebId":"${$.info.MEB_ID}","actId":"${$.info.ACT_ID}","nodeDay":${$.nodeDay},"couponType":${$.couponType},"nodeCouponId":"${$.couponId}","dccpBscInfSn":"${$.dccpBscInfSn}","chnlType":"${$.info.chnlType}","regionCode":"${$.info.regionCode}"}` |
| 221 | } |
| 222 | return new Promise(resolve => { |
| 223 | $.post(opt, async (err, resp, data) => { |
| 224 | try { |
| 225 | err && $.log(err); |
| 226 | if (data) { |
| 227 | data = $.toObj(data); |
| 228 | if (data.errCode == 0) { |
| 229 | $.isGetGift = true; |
| 230 | $.getGiftMsg = `获得签到奖励:${data?.data?.title}(${data?.data?.subTitle})\n`; |
| 231 | $.log($.getGiftMsg); |
| 232 | } else { |
| 233 | $.continue = true; |
| 234 | $.log($.toStr(data)); |
| 235 | } |
| 236 | } else { |
| 237 | $.log("服务器返回了空数据"); |
| 238 | } |
| 239 | } catch (error) { |
| 240 | $.log(error); |
| 241 | } finally { |
| 242 | resolve(); |
| 243 | } |
| 244 | }) |
| 245 | }) |
| 246 | } |
| 247 | |
| 248 | // 获取最新版本 |
| 249 | async function getLatestVersion() { |
no test coverage detected