(options)
| 109 | return require("crypto").createHash("sha1").update(str).digest("hex"); |
| 110 | } |
| 111 | request(options) { |
| 112 | |
| 113 | var sign, |
| 114 | n = void 0 |
| 115 | , d = {}, |
| 116 | l = "R6WbJ830wNsEdjH9GumwKYiYxHz0K9QD", |
| 117 | n = (new Date).getTime(), |
| 118 | d = "post" === options.method || "POST" === options.method ? { |
| 119 | body: JSON.stringify(options.data), |
| 120 | secretKey: l, |
| 121 | ts: n |
| 122 | } : Object.assign({}, options.params, { |
| 123 | secretKey: l, |
| 124 | ts: n |
| 125 | }), |
| 126 | sign = this.sha1(function (e) { |
| 127 | var t, a = []; |
| 128 | for (t in e) { |
| 129 | var r = t + e[t]; |
| 130 | a.push(r) |
| 131 | } |
| 132 | a.sort(); |
| 133 | var u = ""; |
| 134 | return a.map((function (e) { |
| 135 | "" === u ? u = e : u += e |
| 136 | } |
| 137 | )), |
| 138 | u |
| 139 | }(d)) |
| 140 | let baseHeaders = { |
| 141 | host: "mall-mobile-v6.vecrp.com", |
| 142 | "accept": "*/*", |
| 143 | "accept-language": "zh-CN,zh;q=0.9", |
| 144 | "appid": "wxda948f3be0afc375", |
| 145 | "content-type": "application/json;charset=UTF-8", |
| 146 | "sec-fetch-dest": "empty", |
| 147 | "sec-fetch-mode": "cors", |
| 148 | "sec-fetch-site": "cross-site", |
| 149 | "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) UnifiedPCWindowsWechat(0xf254173b) XWEB/19027", |
| 150 | "sign": "" + sign, |
| 151 | "starttime": "" + n, |
| 152 | "token": "" + this.token, |
| 153 | "ts": "" + n, |
| 154 | "x-tracedid": "" + $.uuid(), |
| 155 | "xweb_xhr": "1", |
| 156 | "Referer": "https://servicewechat.com/wxda948f3be0afc375/65/page-frame.html", |
| 157 | } |
| 158 | options.headers = Object.assign(options.headers, baseHeaders) |
| 159 | |
| 160 | return axios.request(options) |
| 161 | } |
| 162 | async signIn() { |
| 163 | let options = { |
| 164 | method: 'POST', |
no test coverage detected