()
| 264 | } |
| 265 | } |
| 266 | async getLoginUrl() { |
| 267 | try { |
| 268 | let timestamp = Date.now(); |
| 269 | const options = { |
| 270 | method: 'GET', |
| 271 | url: `https://mxsa.mxbc.net/api/v1/duiba/getLoginUrl`, |
| 272 | params: { |
| 273 | "appId": "d82be6bbc1da11eb9dd000163e122ecb", |
| 274 | "t": timestamp, |
| 275 | "sign": this.getSHA256withRSA('appId=d82be6bbc1da11eb9dd000163e122ecb&t=' + timestamp) |
| 276 | }, |
| 277 | headers: { |
| 278 | 'Host': 'mxsa.mxbc.net', |
| 279 | 'Connection': 'keep-alive', |
| 280 | 'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 MicroMessenger/7.0.4.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF', |
| 281 | 'xweb_xhr': 1, |
| 282 | 'Access-Token': '' + this.ck, |
| 283 | 'Content-Type': 'application/json', |
| 284 | 'Accept': '*/*', |
| 285 | 'Sec-Fetch-Site': 'cross-site', |
| 286 | 'Sec-Fetch-Mode': 'cors', |
| 287 | 'Sec-Fetch-Dest': 'empty', |
| 288 | 'Referer': 'https://servicewechat.com/wx7696c66d2245d107/59/page-frame.html', |
| 289 | 'Accept-Language': 'en-us,en', |
| 290 | 'Accept-Encoding': 'gzip, deflate', |
| 291 | |
| 292 | } |
| 293 | }; |
| 294 | |
| 295 | let { data: res } = await axios.request(options); |
| 296 | if (res?.code == 0) { |
| 297 | this.activityOrigin = new URL(res?.data.loginUrl).origin; |
| 298 | this.activityUrl = res?.data.loginUrl; |
| 299 | return res?.data.loginUrl; |
| 300 | } else { |
| 301 | $.log(`获取跳转Url失败!原因未知!${res.msg}`); |
| 302 | |
| 303 | } |
| 304 | |
| 305 | } catch (e) { |
| 306 | $.log(`❌获取跳转Url失败!原因为${e}`); |
| 307 | } |
| 308 | } |
| 309 | ObjectKeys2LowerCase(e) { return e = Object.fromEntries(Object.entries(e).map((([e, t]) => [e.toLowerCase(), t]))), new Proxy(e, { get: function (e, t, r) { return Reflect.get(e, t.toLowerCase(), r) }, set: function (e, t, r, n) { return Reflect.set(e, t.toLowerCase(), r, n) } }) } |
| 310 | |
| 311 |
no test coverage detected