尝试使用Uppy JS库通过Laravel上传文件。设置带有参数的简单上传表单:
const options = {
endpoint: '/parts/image-upload',
headers: {
'X-XSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
},
};
uppyDashboard.use(XHRUpload, options);
在后端,我得到
Illuminate\Contracts\Encryption\DecryptException: The payload is invalid. in file /Users/rd/Projects/xxx/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php on line 195
就像Laravel试图解密已经解密的东西一样,无论如何我都处于死胡同。