登录界面调整

This commit is contained in:
dxc
2026-02-04 15:41:51 +08:00
parent ea17413bc1
commit c1c525b699
5 changed files with 73 additions and 34 deletions

View File

@ -28,8 +28,11 @@ def login():
return jsonify(response_data), 200
except ValueError as ve:
# [修改] 捕获业务逻辑错误(如密码错误、用户不存在),返回 401 Unauthorized
return jsonify({'msg': str(ve)}), 401
except Exception as e:
# [修改] 捕获系统级错误(如数据库连接失败),返回 500 Internal Server Error
current_app.logger.error(f"Login Failed Error: {str(e)}")
return jsonify({'msg': f'服务器内部错误: {str(e)}'}), 500