Javascript Firebase数据库正在拒绝请求

Javascript Firebase数据库正在拒绝请求,javascript,firebase-realtime-database,Javascript,Firebase Realtime Database,Firebase实时数据库拒绝了我的请求,我不知道为什么? 我只使用了文档中的简单代码。 这是HTML页面 //您的web应用程序的Firebase配置 //对于Firebase JS SDK v7.20.0及更高版本,measurementId是可选的 var firebaseConfig={ apiKey:“xxxxxxxxx”, authDomain:“app.firebaseapp.com”, 数据库URL:“https://app.firebaseio.com", projectI

Firebase实时数据库拒绝了我的请求,我不知道为什么? 我只使用了文档中的简单代码。 这是HTML页面


//您的web应用程序的Firebase配置
//对于Firebase JS SDK v7.20.0及更高版本,measurementId是可选的
var firebaseConfig={
apiKey:“xxxxxxxxx”,
authDomain:“app.firebaseapp.com”,
数据库URL:“https://app.firebaseio.com",
projectId:“应用程序”,
storageBucket:“jointest jic.appspot.com”,
messagingSenderId:“xxxxxxx”,
appId:“x:xxxxx 4:web:xxxxxxx”,
测量TID:“xCvCxV”
};
//初始化Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
var database=firebase.database();
函数writeUserData(用户名、名称、电子邮件、图像URL){
firebase.database().ref('users/'+userId).set({
用户名:name,
电邮:电邮,,
个人资料图片:imageUrl
});
}

不要忘记为您将要使用的所有组件导入脚本,如
用于使用实时数据库=))

此外,您还需要在firebase web控制台中为数据库正确配置数据库规则


或者在你的firebase.json文件中,正如你所读到的,firebase数据库不是一个函数。>>>未捕获类型错误:firebase.database在HTMLInputElement.onclick(ftp.html:1)的writeUserData(ftp.html:26)不是一个函数。你可以尝试调查
云监控
工具中的一些事件,该链接应位于monitore规则上page@VedNig由于某些原因,它无法初始化您的Firebase。它可能是什么?我也看到了,但它是空的。将
添加到导入中