fixed problem of response object

This commit is contained in:
printempw 2016-02-03 13:28:45 +08:00
parent 3eaddcd6c4
commit 465fa045b1

View File

@ -2,7 +2,7 @@
* @Author: prpr * @Author: prpr
* @Date: 2016-01-21 13:56:40 * @Date: 2016-01-21 13:56:40
* @Last Modified by: prpr * @Last Modified by: prpr
* @Last Modified time: 2016-02-03 10:29:24 * @Last Modified time: 2016-02-03 13:28:19
*/ */
'use strict'; 'use strict';
@ -112,14 +112,14 @@ $("#upload").click(function(){
}, },
success: function(json) { success: function(json) {
console.log(json); console.log(json);
if (json['skin'].errno == 0 && json['cape'].errno == 0) { if (json.skin.errno == 0 && json.cape.errno == 0) {
showMsg("alert-success", "Successfully uploaded."); showMsg("alert-success", "Successfully uploaded.");
} }
if (json['skin'].errno != 0) { if (json.skin.errno != 0) {
showMsg("alert-danger", "Error when uploading skin:\n"+json['skin'].msg); showMsg("alert-danger", "Error when uploading skin:\n"+json.skin.msg);
} }
if (json['cape'].errno != 0) { if (json.cape.errno != 0) {
showMsg("alert-danger", "Error when uploading cape:\n"+json['cape'].msg); showMsg("alert-danger", "Error when uploading cape:\n"+json.cape.msg);
} }
} }
}); });