(size)
| 625 | } |
| 626 | }) |
| 627 | } |
| 628 | |
| 629 | /** |
| 630 | * 下载资源并转换为 Base64 |
| 631 | * @param {string} contentUrl - 资源链接 |
| 632 | * @returns {Promise<string>} Base64 内容 |
| 633 | */ |
| 634 | const downloadAssetAsBase64 = async (contentUrl, account) => { |
| 635 | const proxyAgent = getProxyAgent(account) |
| 636 | const requestConfig = { |
| 637 | responseType: 'arraybuffer', |
| 638 | timeout: 1000 * 60 * 2 |
| 639 | } |
| 640 | |
| 641 | if (proxyAgent) { |
| 642 | requestConfig.httpsAgent = proxyAgent |
| 643 | requestConfig.proxy = false |
| 644 | } |
no outgoing calls
no test coverage detected