xf
This commit is contained in:
@@ -54,14 +54,23 @@ def create_app():
|
||||
|
||||
@app.route('/web/list')
|
||||
def list_emails_page():
|
||||
emails = get_latest_emails(count=50)
|
||||
return render_template('email_list.html', emails=emails)
|
||||
try:
|
||||
# 不指定 recipient,获取所有邮件
|
||||
emails = get_latest_emails(recipient=None, count=50)
|
||||
return render_template('email_list.html', emails=emails)
|
||||
except Exception as e:
|
||||
app.logger.error(f"Error in list_emails_page: {str(e)}")
|
||||
return "获取邮件列表失败", 500
|
||||
|
||||
@app.route('/email/<recipient>')
|
||||
@app.route('/web/email/<recipient>')
|
||||
def view_email_page(recipient):
|
||||
email = get_latest_email_with_code(recipient)
|
||||
if email:
|
||||
return render_template('email_detail.html', email=email)
|
||||
return "邮件不存在", 404
|
||||
try:
|
||||
email = get_latest_email_with_code(recipient)
|
||||
if email:
|
||||
return render_template('email_detail.html', email=email)
|
||||
return "邮件不存在", 404
|
||||
except Exception as e:
|
||||
app.logger.error(f"Error in view_email_page: {str(e)}")
|
||||
return "获取邮件详情失败", 500
|
||||
|
||||
return app
|
||||
Reference in New Issue
Block a user