This commit is contained in:
hailin 2024-10-28 20:38:37 +08:00
parent 2214cd3a9c
commit 264a4428f8
2 changed files with 6 additions and 1 deletions

5
app.py
View File

@ -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/<int:index>')
def view_customer(index):
# 判断是否有数据

View File

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