PicGo/PicGo-Core

upload e.startsWith is not a function

lslive opened this issue · 1 comments

const resUpload: any = await picgo.upload([{
base64Image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAALzklEQVR4Xu3aMY+mZRWA4WcxCoXbKEYCIcTEWMgvMKFS/oOVNJJQUFFhRWEllZWdNJj4A6yFWFlZ2EACFkqMBhK0YAlxNbLmc3gz73wO2Y0wm++ec9GJw3Ce65zc+WbYG3d+t+4sfxEgQCAgcEOwAlsyIgEC/xUQLIdAgEBGQLAyqzIoAQKC5QYIEMgICFZmVQYlQECw3AABAhkBwcqsyqAECAiWGyBAICMgWJlVGZQAAcFyAwQIZAQEK7MqgxIgIFhugACBjIBgZVZlUAIEBMsNECCQERCszKoMSoCAYLkBAgQyAoKVWZVBCRAQLDdAgEBGQLAyqzIoAQKC5QYIEMgICFZmVQYlQECw3AABAhkBwcqsyqAECAiWGyBAICMgWJlVGZQAAcFyAwQIZAQEK7MqgxIgIFhugACBjIBgZVZlUAIEBMsNECCQERCszKoMSoCAYLkBAgQyAoKVWZVBCRAQLDdAgEBGQLAyqzIoAQKC5QYIEMgICFZmVQYlQECw3AABAhkBwcqsyqAECAiWGyBAICMgWJlVGZQAAcFyAwQIZAQEK7MqgxIgIFhugACBjIBgZVZlUAIEBMsNECCQERCszKoMSoCAYLkBAgQyAoKVWZVBCRAQLDdAgEBGQLAyqzIoAQKC5QYIEMgICFZmVQYlQECw3AABAhkBwcqsyqAECAiWGyBAICMgWJlVGZQAAcFyAwQIZAQEK7MqgxIgIFhugACBjIBgZVZlUAIEBMsNECCQERCszKoMSoCAYLkBAgQyAoKVWZVBCRAQLDdAgEBGQLAyqzIoAQKC5QYIEMgICFZmVQYlQECw3AABAhkBwcqsyqAECAiWGyBAICMgWJlVGZQAAcFyAwQIZAQEK7MqgxIgIFhugACBjIBgZVZlUAIEBMsNECCQERCszKoMSoCAYLkBAgQyAoKVWZVBCRAQLDdAgEBGQLAyqzIoAQ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ECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeECgjX8ADyfQElAsErbMiuB4QKCNfwAPJ9ASUCwStsyK4HhAoI1/AA8n0BJQLBK2zIrgeEC/wE8uEAwMtEsKwAAAABJRU5ErkJggg==',
fileName: '123123123',
width: '300',
height: '300',
extname: '.jpg'
}]);
上传图片显示错误 不是可以使用bese64吗 现在报错
[PicGo INFO]: Before transform
[PicGo INFO]: Transforming... Current transformer is [path]
[PicGo WARN]: failed
[PicGo ERROR]: TypeError: e.startsWith is not a function
at se (D:\work\Next\node_modules\picgo\dist\index.cjs.js:1:2253)
at D:\work\Next\node_modules\picgo\dist\index.cjs.js:1:41722
at Array.map ()
at Object.handle (D:\work\Next\node_modules\picgo\dist\index.cjs.js:1:41684)
at $e.doTransform (D:\work\Next\node_modules\picgo\dist\index.cjs.js:1:18776)
at $e.start (D:\work\Next\node_modules\picgo\dist\index.cjs.js:1:17937)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Tt.upload (D:\work\Next\node_modules\picgo\dist\index.cjs.js:1:78698)
at async Upload (webpack-internal:///(api)/./pages/api/upload/cludeimg.ts:43:23)
at async Object.apiResolver (D:\work\Next\node_modules\next\dist\server\api-utils\node.js:366:9)
wait - compiling...

请注意看文档 上传base64图片需要改tansformer以及对应的输入要求。