slaprunner: don't send 200 when login is bad.

parent 21cbde9d
...@@ -32,8 +32,14 @@ $(document).ready(function () { ...@@ -32,8 +32,14 @@ $(document).ready(function () {
$("#error").Popup(data.result, {type: 'alert', duration: 3000}); $("#error").Popup(data.result, {type: 'alert', duration: 3000});
} }
}) })
.error(function () { .error(function (response) {
$("#error").Popup("Cannot send your account identifier please try again!!", if (response && response.status === 401) {
$("#error").Popup('Login and/or password is incorrect.',
{type: 'alert', duration: 3000}
);
return
}
$("#error").Popup("Cannot send your account identifier",
{type: 'alert', duration: 3000}); {type: 'alert', duration: 3000});
}) })
.complete(function () { .complete(function () {
......
...@@ -106,7 +106,7 @@ def doLogin(): ...@@ -106,7 +106,7 @@ def doLogin():
# Authenticate and log in! # Authenticate and log in!
if g.users[username].authenticate(request.form['cpwd']): if g.users[username].authenticate(request.form['cpwd']):
return jsonify(code=1, result="") return jsonify(code=1, result="")
return jsonify(code=0, result="Login or password is incorrect, please check it!") return jsonify(code=0, result="Login or password is incorrect, please check it!"), 401
# software views # software views
@login_required() @login_required()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment