From 264a4428f8c3602db62d49b79ea617db6f61e821 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 28 Oct 2024 20:38:37 +0800 Subject: [PATCH] . --- app.py | 5 +++++ caller.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 663ef83..e16f591 100644 --- a/app.py +++ b/app.py @@ -81,6 +81,11 @@ def load_indices_from_es(key: str, index: str, buf: Dict[str, Any]) -> Any: return None +@app.route('/') +def index(): + # 默认展示第一个客户 + return redirect(url_for('view_customer', index=0)) + @app.route('/customer/') def view_customer(index): # 判断是否有数据 diff --git a/caller.py b/caller.py index 3e7a402..3bca0b1 100644 --- a/caller.py +++ b/caller.py @@ -7,7 +7,7 @@ from datetime import datetime, timezone # 传递数据并启动 Flask 应用 # store_to_es(key, buf, 'customer') - +# key全局变量,在app.py中定义 ret = load_indices_from_es(key, 'customer', buf) if not ret: exit("客服AI员工不能拥有数据库。")