feat: 添加管理员邮箱并替换CDN为本地bootstrap文件

添加ADMIN_EMAIL配置用于发送审核通知邮件
将所有页面引用的bootstrap CDN替换为本地/js/bootstrap.bundle.js
This commit is contained in:
2025-07-11 23:02:37 +08:00
parent 6e14cc7a56
commit cabbb6f83a
17 changed files with 47 additions and 16 deletions

View File

@@ -210,6 +210,6 @@ if (!($conn instanceof mysqli)) {
</div>
</div>
<!-- Bootstrap JS and Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="/js/bootstrap.bundle.js"></script>
</body>
</html>

View File

@@ -117,6 +117,6 @@ if (!($conn instanceof mysqli)) {
还没有账号?<a href="register.php" class="text-decoration-none">注册</a>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="/js/bootstrap.bundle.js"></script>
</body>
</html>

View File

@@ -224,6 +224,6 @@ $mail->AuthType = 'PLAIN'; // 尝试使用PLAIN认证方式
<button type="submit" class="btn btn-primary w-100">注册</button>
</form>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="/js/bootstrap.bundle.js"></script>
</body>
</html>

View File

@@ -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)) {
}
</style>
<!-- Bootstrap JS with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="/js/bootstrap.bundle.js"></script>
</head>
<!-- 导航栏 -->