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>
翻翻过去那场雪
相关分类