当我尝试通过firebase函数中的admin SDK访问firebase存储时,它在admin.storage()上失败,但是在admin.database()上成功,有什么建议吗?
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const serviceAccount = require("./myapp-ea8ed-firebase-adminsdk-140ib-682f0b6fce.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://myapp-ea8ed.firebaseio.com"
});
在功能中,我可以通过
访问firebase数据库const ref = admin.database().ref("/root");
但无法通过
访问Firebase存储const bucket = admin.storage().bucket("myapp-ea8ed.appspot.com");