This commit is contained in:
parent
2214cd3a9c
commit
264a4428f8
5
app.py
5
app.py
|
|
@ -81,6 +81,11 @@ def load_indices_from_es(key: str, index: str, buf: Dict[str, Any]) -> Any:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/')
|
||||||
|
def index():
|
||||||
|
# 默认展示第一个客户
|
||||||
|
return redirect(url_for('view_customer', index=0))
|
||||||
|
|
||||||
@app.route('/customer/<int:index>')
|
@app.route('/customer/<int:index>')
|
||||||
def view_customer(index):
|
def view_customer(index):
|
||||||
# 判断是否有数据
|
# 判断是否有数据
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from datetime import datetime, timezone
|
||||||
# 传递数据并启动 Flask 应用
|
# 传递数据并启动 Flask 应用
|
||||||
# store_to_es(key, buf, 'customer')
|
# store_to_es(key, buf, 'customer')
|
||||||
|
|
||||||
|
# key全局变量,在app.py中定义
|
||||||
ret = load_indices_from_es(key, 'customer', buf)
|
ret = load_indices_from_es(key, 'customer', buf)
|
||||||
if not ret:
|
if not ret:
|
||||||
exit("客服AI员工不能拥有数据库。")
|
exit("客服AI员工不能拥有数据库。")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue