簡體   English   中英

Parse.com雲錯誤請求400

[英]Parse.com cloud bad request 400

我使用Parse.com雲來管理移動應用程序的數據庫。 當我在表用戶中保存某個具有相同用戶名或電子郵件的用戶時,出現以下錯誤:

POST https://api.parse.com/1/users 400 (Bad Request)

我自己理解,當不同用戶名或電子郵件名相同時,會出現錯誤。 是否有返回錯誤原因的方法,例如“已選擇此郵件”? 在我的代碼下面:

 saveUser: function() {
        this.utente.save(null, {
            success: function(persona) {
                //console.log("modello salvato nel db");
                var id = persona.get("objectId");
                window.localStorage.setItem('parseId', id);
            },
            error: function(error) {
                alert("Save error");
                console.log(error);


            }
        });

    },

看起來您沒有在任何地方使用response.error(error) ...

嘗試

saveUser: function() {
    this.utente.save(null, {
        success: function(persona) {
            //console.log("modello salvato nel db");
            var id = persona.get("objectId");
            window.localStorage.setItem('parseId', id);
        },
        error: function(error) {
            response.error(error);
        }
    });
}

然后在您的本機腳本console.log中記錄error.code和error.message。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM