Initial commit: 投注游戏平台初始化

This commit is contained in:
li
2026-02-25 01:26:58 +08:00
commit 77ca2cc8b3
275 changed files with 237479 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Core;
class AdminBaseController extends BaseController
{
public function __construct()
{
}
// 检测是否是管理员
protected function checkAdmin()
{
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
if (!isset($_SESSION['role']) || $_SESSION['role'] !== 'admin') {
if (
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&
strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'
) {
header('Content-Type: application/json');
echo json_encode([
'status' => 'error',
'message' => '您没有权限访问该功能'
]);
} else {
echo "<script>alert('您没有权限访问该功能');history.back();</script>";
}
exit;
}
}
}