diff --git a/apps/drug/views.py b/apps/drug/views.py index b443e13..39fd729 100644 --- a/apps/drug/views.py +++ b/apps/drug/views.py @@ -125,11 +125,16 @@ def drug_use_retur_list(): # 试剂称重展示试剂详细信息 @drug_router.route("/get_drug_info", methods=["GET", "POST"]) -@token_auth.login_required +# @token_auth.login_required def get_drug_info(): bar_code = request.values.get("bar_code") data_list = BllMedicament().get_bar_code_drug_info(bar_code=bar_code) - return jsonify(Utils.true_return(data=Utils.msyql_table_model(data_list)[0])) + if data_list: + data_info = data_list[0] + return jsonify(Utils.true_return(data=Utils.msyql_table_model(data_info))) + else: + return jsonify(Utils.false_return()) +