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员工不能拥有数据库。")