diff --git a/app.py b/app.py index 67617ad..869167f 100644 --- a/app.py +++ b/app.py @@ -212,7 +212,10 @@ def register_routes(app, db): flash('短信不存在', 'error') return redirect(url_for('index')) - return render_template('message_detail.html', message=message) + # 获取来源页面,默认返回列表 + back_url = request.args.get('back') or request.referrer or url_for('index') + + return render_template('message_detail.html', message=message, back_url=back_url) @app.route('/logs') @login_required diff --git a/sms_receiver.service b/sms_receiver.service index ed51304..0414674 100644 --- a/sms_receiver.service +++ b/sms_receiver.service @@ -3,15 +3,15 @@ Description=SMS Receiver Web Service After=network.target [Service] -Type=forking +Type=simple User=root WorkingDirectory=/root/.openclaw/workspace/sms-receiver -ExecStart=/root/.openclaw/workspace/sms-receiver/sms_receiverctl.sh start -ExecStop=/root/.openclaw/workspace/sms-receiver/sms_receiverctl.sh stop -ExecReload=/root/.openclaw/workspace/sms-receiver/sms_receiverctl.sh restart -PIDFile=/root/.openclaw/workspace/sms-receiver/sms_receiver.pid +Environment="PYTHONUNBUFFERED=1" +ExecStart=/usr/bin/python3 app.py Restart=always RestartSec=5 +StandardOutput=append:/root/.openclaw/workspace/sms-receiver/sms_receiver.log +StandardError=append:/root/.openclaw/workspace/sms-receiver/sms_receiver.log [Install] WantedBy=multi-user.target diff --git a/templates/message_detail.html b/templates/message_detail.html index 5e82009..73d7f04 100644 --- a/templates/message_detail.html +++ b/templates/message_detail.html @@ -146,7 +146,7 @@

📱 短信详情 #{{ message.id }}

diff --git a/templates/statistics.html b/templates/statistics.html index f9be9d0..0c54cb4 100644 --- a/templates/statistics.html +++ b/templates/statistics.html @@ -305,7 +305,7 @@ {% if msg.ip_address %} 🌐 {{ msg.ip_address }} {% endif %} - 查看详情 + 查看详情