亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Firebase 數據庫正在拒絕請求

Firebase 數據庫正在拒絕請求

隔江千里 2023-05-11 13:20:30
Firebase 實時數據庫正在拒絕我的請求,我不知道為什么? 看到這個 我只使用了文檔中的簡單代碼。這是 HTML 頁面。<script src="https://www.gstatic.com/firebasejs/7.23.0/firebase-app.js"></script><script src="https://www.gstatic.com/firebasejs/7.23.0/firebase-analytics.js"></script><script>  // Your web app's Firebase configuration  // For Firebase JS SDK v7.20.0 and later, measurementId is optional  var firebaseConfig = {    apiKey: "xxxxxxxxx",    authDomain: "app.firebaseapp.com",    databaseURL: "https://app.firebaseio.com",    projectId: "app",    storageBucket: "jointest-jic.appspot.com",    messagingSenderId: "xxxxxxx",    appId: "x:xxxxx4:web:xxxxxxx",    measurementId: "xcxvcxv"  };  // Initialize Firebase  firebase.initializeApp(firebaseConfig);  firebase.analytics();  var database = firebase.database();  function writeUserData(userId, name, email, imageUrl) {  firebase.database().ref('users/' + userId).set({    username: name,    email: email,    profile_picture : imageUrl  });}</script><body><input type="submit" onclick="writeUserData(userId, name, email, ageUrl)"></body>
查看完整描述

1 回答

?
翻翻過去那場雪

TA貢獻2065條經驗 獲得超14個贊

不要忘記為您將使用的所有組件導入腳本,例如<script src="https://www.gstatic.com/firebasejs/7.23.0/firebase-database.js"></script>使用實時數據庫 =))

您還需要在 firebase web 控制臺中為您的數據庫正確配置數據庫規則

http://img1.sycdn.imooc.com/645c7b400001a7f703880374.jpg

查看完整回答
反對 回復 2023-05-11
  • 1 回答
  • 0 關注
  • 119 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號