()
| 286 | } |
| 287 | |
| 288 | async generate() { |
| 289 | const lid = await this.getLid(); |
| 290 | const param = dxEncrypt(this.mergeOptions({ lid, cache: !!this.options.cache })); |
| 291 | const data = await this.request(param, this.getToken()); |
| 292 | const status = Number(data.status); |
| 293 | if (status === 1 || status === 2) { |
| 294 | this.setToken(data.data); |
| 295 | return data.data; |
| 296 | } |
| 297 | if (status === -4 && data.data) { |
| 298 | DX_STORAGE.set(DX_LID_KEY, data.data); |
| 299 | return this.detect(); |
| 300 | } |
| 301 | return this.detect(); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | async function getDxToken() { |
no test coverage detected