diff --git a/app.py b/app.py index 3a77b3e..86e47ee 100644 --- a/app.py +++ b/app.py @@ -322,7 +322,24 @@ def search_by_email(): return "Email address not found.", 404 +# 新增根据域名搜索的路由 +@app.route('/search_domain') +def search_by_domain(): + domain = request.args.get('domain') + if not domain: + return "Domain is required.", 400 + # 遍历 customer_data 查找匹配的域名 + for index, customer in enumerate(customer_data): + if domain in customer: + # 找到匹配的域名,跳转到对应的 index + return redirect(url_for('view_customer', index=index)) + + # 如果没有找到匹配的域名 + return "Domain not found.", 404 + + + # # 提取字段结构 # field_structure = extract_index_structure(es, 'customer') diff --git a/templates/edit_customers.html b/templates/edit_customers.html index e782f61..ac69205 100644 --- a/templates/edit_customers.html +++ b/templates/edit_customers.html @@ -68,8 +68,17 @@ + + + +