feat: 添加应用审核状态检查和使用SweetAlert弹窗
- 在app.php中添加应用审核状态检查,未通过审核时显示提示弹窗 - 引入SweetAlert2库用于统一弹窗样式 - 修改登录逻辑支持邮箱/用户名两种登录方式 - 修复profile.php中的表单标签错误 - 在数据库中添加is_approved字段标记应用审核状态 - 添加项目规则文档规定统一使用SweetAlert弹窗
This commit is contained in:
21
app.php
21
app.php
@@ -28,6 +28,24 @@ if (!$app) {
|
||||
die("<h1>错误:应用不存在</h1><p>找不到ID为 $appId 的应用。请检查ID是否正确。</p>");
|
||||
}
|
||||
|
||||
// 检查应用审核状态
|
||||
if ($app['status'] != 'approved') {
|
||||
echo '<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
Swal.fire({
|
||||
title: "应用审核中",
|
||||
text: "该应用正在审核中,暂时无法访问。",
|
||||
icon: "info",
|
||||
confirmButtonText: "确定"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.history.back();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
// 处理评价加载请求
|
||||
if (isset($_GET['action']) && $_GET['action'] === 'load_reviews') {
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
@@ -118,6 +136,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['rating'])) {
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<!-- SweetAlert2 -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js"></script>
|
||||
<!-- 本地 Chart.js -->
|
||||
<script src="js/charts.js"></script>
|
||||
<!-- 自定义CSS -->
|
||||
|
||||
Reference in New Issue
Block a user