()
| 274 | } |
| 275 | |
| 276 | async detect() { |
| 277 | const lid = await this.getLid(); |
| 278 | const collected = await dxCollect(this.options); |
| 279 | const param = dxEncrypt(this.mergeOptions({ lid, ...collected })); |
| 280 | const data = await this.request(param, ""); |
| 281 | if (Number(data.status) === 2) { |
| 282 | this.setToken(data.data); |
| 283 | return data.data; |
| 284 | } |
| 285 | throw new Error(`dx status: ${data.status}`); |
| 286 | } |
| 287 | |
| 288 | async generate() { |
| 289 | const lid = await this.getLid(); |