v1.1.1: 安装统计时间统一为北京时间(UTC+8)

- MySQL 默认时区 +08:00, PHP Asia/Shanghai
- 历史安装时间 UTC→+8 转换
- 安装/版本接口与页面按北京时间展示
This commit is contained in:
root committed 2026-10-08 19:01:29 +08:00
1 parent e809b7a903
commit d4ed9c3dcf
10 files changed
+118 -19

No files matched your search

+10 -1
View File
@@ -23,10 +23,16 @@ PAYMENT_API_URL=${PAYMENT_API_URL:-}
PAYMENT_APP_ID=${PAYMENT_APP_ID:-}
PAYMENT_APP_KEY=${PAYMENT_APP_KEY:-}
EOF
chmod 600 /var/www/.env
chmod 644 /var/www/.env
echo ">>> .env generated"
fi
# 时区:统一北京时间
export TZ=Asia/Shanghai
if [ ! -f /usr/local/etc/php/conf.d/timezone.ini ]; then
echo "date.timezone = Asia/Shanghai" > /usr/local/etc/php/conf.d/timezone.ini
fi
# 等待 MySQL 就绪
echo ">>> Waiting for MySQL at ${DB_HOST}:${DB_PORT}..."
until nc -z ${DB_HOST} ${DB_PORT} 2>/dev/null; do
@@ -34,5 +40,8 @@ until nc -z ${DB_HOST} ${DB_PORT} 2>/dev/null; do
done
echo ">>> MySQL is ready"
# 确保 MySQL 会话时区为北京时间
mysql -h"${DB_HOST}" -P"${DB_PORT}" -u"${DB_USER}" -p"${DB_PASS}" -e "SET GLOBAL time_zone='+08:00';" 2>/dev/null || true
# 启动 Supervisor (Nginx + PHP-FPM)
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf