当我在aws s3中上传文件时,它会向我返回此错误
const data = [
{'a':123,'b':345,'c':{'b1':1,'b2':2,'b3':3}},
{'a':234,'b':456,'c':{'b1':2,'b2':4,'b3':6}},
{'a':345,'b':567,'c':{'b1':3,'b2':6,'b3':9}}
];
const sumProps = (o) =>
Object.values(o) // get the values of an object
.reduce((r, v) => // iterate the values
r + (typeof v === 'object' ? sumProps(v) : v) // add the values to the previous sum, and if the values are an object sum it recursively
, 0);
// iterate the objects with map
const result = data.map(({ a, ...rest }) => { // destructure a, and an object of all other params
return ({ // combine them back to an object
a,
...rest, // spread the rest object
d: sumProps(rest) // get the sum of the rest, and assign to d
});
});
console.log(result);
我使用Node js。
答案 0 :(得分:1)
以下是S3访问AccessDenied的可能原因:
还有关于how to troubleshoot 403 Access Denied的一些想法。