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

@@ -257,7 +257,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_app'])) {
</div>
<!-- Bootstrap JS Bundle 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>
<script>
// 年龄分级说明显示控制
const ageRatingSelect = document.getElementById('age_rating');

View File

@@ -158,7 +158,7 @@ $result = $conn->query($sql);
</div>
<!-- Bootstrap JS Bundle 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>
<script>
// 导航栏滚动效果
window.addEventListener('scroll', function() {

View File

@@ -298,7 +298,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['edit_app'])) {
</div>
<!-- Bootstrap JS Bundle 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>
<script>
// 年龄分级说明显示控制
// 年龄分级说明显示控制

View File

@@ -144,7 +144,7 @@ if (!$resultApps) {
</div>
<!-- Bootstrap JS Bundle 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>
<script>
// 导航栏滚动效果
window.addEventListener('scroll', function() {

View File

@@ -104,7 +104,7 @@ if (!isset($_SESSION['admin'])) {
echo ' </div>';
echo ' </div>';
echo ' <!-- Bootstrap JS Bundle with Popper -->';
echo ' <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>';
echo ' <script src="/js/bootstrap.bundle.js"></script>';
echo '</body>';
echo '</html>';
exit;

View File

@@ -208,7 +208,7 @@ if (!$stmt) {
</head>
<body>
<!-- Bootstrap JS Bundle 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>
<script>
// 导航栏滚动效果
window.addEventListener('scroll', function() {

View File

@@ -346,7 +346,7 @@ if (isset($_GET['success'])) {
</div>
<!-- Bootstrap JS Bundle 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>
<script>
// 导航栏滚动效果
window.addEventListener('scroll', function() {

View File

@@ -311,7 +311,7 @@ function showRejectReason(appId, appName) {
</div>
<!-- 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>
<!-- SweetAlert2 JS -->
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js"></script>
</body>

View File

@@ -174,7 +174,7 @@ $uploaded_files = get_uploaded_files_info();
</div>
<!-- Bootstrap JS Bundle 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>
<script>
document.getElementById('selectAll').addEventListener('change', function() {
const checkboxes = document.querySelectorAll('input[name="delete_files[]"]');

View File

@@ -447,7 +447,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['rating'])) {
</div>
<!-- Bootstrap JS Bundle 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>
<script>
// 导航栏滚动效果
window.addEventListener('scroll', function() {

View File

@@ -8,6 +8,9 @@ define('DB_PASSWORD', 'caocao123');
// App Store 名称
define('APP_STORE_NAME', 'LeonAPP');
// 管理员邮箱
define('ADMIN_EMAIL', 'leonmmcoset@outlook.com');
// SMTP邮件配置
define('SMTP_HOST', 'smtp.163.com');
define('SMTP_PORT', 25); // 163邮箱推荐使用587端口

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>
<!-- 导航栏 -->

View File

@@ -250,6 +250,6 @@
</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

@@ -380,7 +380,7 @@ $announcement = $announcementResult && $announcementResult->num_rows > 0 ? $anno
</div>
<!-- Bootstrap JS Bundle 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>
<script>
// 导航栏滚动效果
window.addEventListener('scroll', function() {