0

大家好,

我想用 Firebase 开始我的网站,但我想我错过了一些东西。对于我的测试,我只有一页。

var config = {
    apiKey: "xxxxxxxxxxxxxxxxxxx",
    authDomain: "xxxxxxxxx.firebaseapp.com",
    databaseURL: "https://xxxxxxx.firebaseio.com",
    projectId: "xxxxxx",
    storageBucket: "xxxxxx.appspot.com",
    messagingSenderId: "xxxxxxxxxxxx"
};
firebase.initializeApp(config);

firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
    var errorCode = error.code;
    var errorMessage = error.message;
    if (errorCode == 'auth/weak-password') {
        alert('The password is too weak.');
    } else {
        alert(errorMessage);
    }
    console.log(error);
});

我有一个错误

无法加载https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=AIzaSyCxa9cGDUAuR03RuCgPeyvNzsYVJ8xwXVU:对预检请求的响应未通过访问控制检查:不存在“Access-Control-Allow-Origin”标头在请求的资源上。因此,不允许访问 Origin 'xxxxxxxxxxxxxxxxxxxxxxx'。响应具有 HTTP 状态代码 404。

你有想法吗 ?

Ps:我在在线IDE,codeanywhere

谢谢

4

0 回答 0