为什么私有存储路径与 Cognito 用户 ID 不匹配?如何访问私有级别的文件?

问题描述

我正在写入私有 S3 存储桶。尝试读取路径时,UUID 与我当前的 Cognito 用户 ID 不同。任何想法为什么会这样?以及如何正确访问这些文件

我正在尝试:

import Storage from '@aws-amplify/storage';

const res = await Storage.vault.get('reports/'); 
const res1 = Storage.list(`reports/`,{ level: 'private' })

在网络选项卡上,我可以看到它也添加了区域作为前缀:private/us-east-1:ar15e955-e51d-42f2-8f54-eaff9f47fbb5/reports/

类似的已关闭问题:https://github.com/aws-amplify/amplify-js/issues/364

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)