前端 422 代码不理解?
能否详细的讲解一下这段代码?谢谢了
else if (error.response.status === 422) {
// http 状态码为 422 代表用户输入校验失败
var html = '
';
.each(error.response.data.errors, function (errors) {
.each(errors, function (error) {
html += error+'
';
})
});
html += '
.each(error.response.data.errors, function (errors) {
.each(errors, function (error) {
html += error+'
';
})
});
html += '
';
swal({content: $(html)[0], icon: 'error'})
}
推荐文章: