From 5b356711a199b3aa2d300f351ed2fad51a29b0f1 Mon Sep 17 00:00:00 2001 From: newrain001 Date: Thu, 17 Oct 2024 20:03:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'app.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index b3a0c08..7baa357 100644 --- a/app.py +++ b/app.py @@ -13,7 +13,7 @@ def shop_random(): return shop def send_queue(data={}): - credentials = pika.PlainCredentials('newrain', '123456') + credentials = pika.PlainCredentials(settings.MQUser, settings.MQPassword) connection = pika.BlockingConnection(pika.ConnectionParameters(settings.MQHost, settings.MQPort, credentials=credentials)) channel = connection.channel() @@ -29,7 +29,7 @@ def send_queue(data={}): def read_queue(): # 建立与RabbitMQ服务器的连接 - credentials = pika.PlainCredentials('newrain', '123456') + credentials = pika.PlainCredentials(settings.MQUser, settings.MQPassword) connection = pika.BlockingConnection( pika.ConnectionParameters(host=settings.MQHost, port=settings.MQPort, credentials=credentials) ) @@ -59,7 +59,7 @@ def index(): @app.route('/read', methods=["GET","POST"]) def read(): - credentials = pika.PlainCredentials('newrain', '123456') + credentials = pika.PlainCredentials(settings.MQUser, settings.MQPassword) connection = pika.BlockingConnection( pika.ConnectionParameters(host=settings.MQHost, port=settings.MQPort, credentials=credentials) )