我正在使用Evaporate(https://github.com/TTLabs/EvaporateJS)将我的文件上传到S3。该应用程序在Vue / Nuxt.js设置中,这是我的配置:
const uploadApiConfig = {
signerUrl: '/api/sign_auth',
awsRegion: process.env.awsRegion,
aws_key: process.env.awsKey,
bucket: process.env.awsBucket,
computeContentMd5: true,
awsSignatureVersion: '4',
cryptoMd5Method: (data) => {
return AWS.util.crypto.md5(data, 'base64')
},
cryptoHexEncodedHash256: (data) => {
return AWS.util.crypto.sha256(data, 'hex')
},
signHeaders: {
'authorization': `Bearer ${token}`
}
}
但仍然出现此错误Failed to execute 'setRequestHeader' on 'XMLHttpRequest': 'AWS4-HMAC-SHA256 Credential=.../s3/aws4_request, SignedHeaders=host;x-amz-date
任何人都可以提供帮助吗?