如何解决“资源加载失败:服务器响应,状态为403()” firebase存储网站

时间:2019-02-16 13:40:39

标签: javascript firebase firebase-storage

当我单击名为save的图标时,我就有此代码,它应该下载文件。

save.addEventListener('click',function(){
            var url=save.getAttribute('url');
            //console.log(url);
            var xhr = new XMLHttpRequest();
              xhr.responseType = 'blob';
              xhr.onload = function(event) {
                var blob = xhr.response;
              };
              xhr.open('GET', url);
              xhr.send();
        });

相反,我在第xhr.send()行出现了以下错误

Failed to load resource: the server responded with a status of 403 ()

它存储在URL的firestore中。 应用的cors规则看起来像

[
  {
    "origin": ["*"],
    "method": ["GET"],
    "maxAgeSeconds": 3600
  }
]

如何清除此错误

0 个答案:

没有答案