From cabbb6f83a1a4214d4714c4a454511ef39ae653b Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Fri, 11 Jul 2025 23:02:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E9=82=AE=E7=AE=B1=E5=B9=B6=E6=9B=BF=E6=8D=A2CDN?= =?UTF-8?q?=E4=B8=BA=E6=9C=AC=E5=9C=B0bootstrap=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加ADMIN_EMAIL配置用于发送审核通知邮件 将所有页面引用的bootstrap CDN替换为本地/js/bootstrap.bundle.js --- admin/addapp.php | 2 +- admin/announcements.php | 2 +- admin/editapp.php | 2 +- admin/index.php | 2 +- admin/login.php | 2 +- admin/manage_developers.php | 2 +- admin/manage_versions.php | 2 +- admin/review_apps.php | 2 +- admin/system_info.php | 2 +- app.php | 2 +- config.php | 3 +++ developer/dashboard.php | 2 +- developer/login.php | 2 +- developer/register.php | 2 +- developer/upload_app.php | 30 +++++++++++++++++++++++++++++- docs/app_review_standards.php | 2 +- index.php | 2 +- 17 files changed, 47 insertions(+), 16 deletions(-) diff --git a/admin/addapp.php b/admin/addapp.php index 8d3c00c..4a0e719 100644 --- a/admin/addapp.php +++ b/admin/addapp.php @@ -257,7 +257,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_app'])) { - + + + + '; + echo ' '; echo ''; echo ''; exit; diff --git a/admin/manage_developers.php b/admin/manage_developers.php index 04ffbf6..a3ade78 100644 --- a/admin/manage_developers.php +++ b/admin/manage_developers.php @@ -208,7 +208,7 @@ if (!$stmt) { - + + + diff --git a/admin/system_info.php b/admin/system_info.php index ff7e427..a880739 100644 --- a/admin/system_info.php +++ b/admin/system_info.php @@ -174,7 +174,7 @@ $uploaded_files = get_uploaded_files_info(); - + + + \ No newline at end of file diff --git a/developer/login.php b/developer/login.php index e6f2a54..8e2c1ed 100644 --- a/developer/login.php +++ b/developer/login.php @@ -117,6 +117,6 @@ if (!($conn instanceof mysqli)) { 还没有账号?注册 - + \ No newline at end of file diff --git a/developer/register.php b/developer/register.php index 4dbbef1..8202a7d 100644 --- a/developer/register.php +++ b/developer/register.php @@ -224,6 +224,6 @@ $mail->AuthType = 'PLAIN'; // 尝试使用PLAIN认证方式 - + \ No newline at end of file diff --git a/developer/upload_app.php b/developer/upload_app.php index 00373b7..eac9273 100644 --- a/developer/upload_app.php +++ b/developer/upload_app.php @@ -196,6 +196,34 @@ if (!($conn instanceof mysqli)) { log_info("应用已插入数据库: ID=$appId, 状态=pending", __FILE__, __LINE__); $stmt->close(); + // 发送审核邮件给管理员 + require_once '../vendor/autoload.php'; + + $subject = '新应用待审核'; + $body = "开发者提交了新应用,应用ID: $appId,名称: $appName,请及时审核。"; + + $mail = new PHPMailer\PHPMailer\PHPMailer(); + $mail->isSMTP(); + $mail->Host = SMTP_HOST; + $mail->SMTPAuth = true; + $mail->Username = SMTP_USERNAME; + $mail->Password = SMTP_PASSWORD; + $mail->SMTPSecure = SMTP_ENCRYPTION; + $mail->Port = SMTP_PORT; + + $mail->setFrom(SMTP_FROM_EMAIL, SMTP_FROM_NAME); + $mail->addAddress(ADMIN_EMAIL); + + $mail->isHTML(false); + $mail->Subject = $subject; + $mail->Body = $body; + + if(!$mail->send()) { + log_error('发送审核邮件失败: ' . $mail->ErrorInfo, __FILE__, __LINE__); + } else { + log_info('已成功发送审核邮件给管理员', __FILE__, __LINE__); + } + log_info("开始处理应用关联数据: ID=$appId", __FILE__, __LINE__); // 插入应用标签关联 foreach ($tags as $tagId) { @@ -287,7 +315,7 @@ if (!($conn instanceof mysqli)) { } - + diff --git a/docs/app_review_standards.php b/docs/app_review_standards.php index de28a9d..f9e64a9 100644 --- a/docs/app_review_standards.php +++ b/docs/app_review_standards.php @@ -250,6 +250,6 @@ - + \ No newline at end of file diff --git a/index.php b/index.php index 98ced7b..d4e4549 100644 --- a/index.php +++ b/index.php @@ -380,7 +380,7 @@ $announcement = $announcementResult && $announcementResult->num_rows > 0 ? $anno - +