35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
||
declare(strict_types=1);
|
||
require_once __DIR__ . '/includes/bootstrap.php';
|
||
// 简单的登录逻辑占位,后续可替换为基于DB的账户系统
|
||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||
// 后续对接RBAC
|
||
if ($_POST['password'] === 'admin') {
|
||
session_start();
|
||
$_SESSION['user_type'] = 'admin';
|
||
header('Location: admin.php');
|
||
exit;
|
||
}
|
||
}
|
||
?>
|
||
<!doctype html>
|
||
<html lang="zh">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>系统登录</title>
|
||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||
</head>
|
||
<body class="bg-light d-flex align-items-center justify-content-center" style="height:100vh;">
|
||
<div class="card p-4" style="width: 300px;">
|
||
<h4 class="mb-3">系统登录</h4>
|
||
<form method="post">
|
||
<div class="mb-3">
|
||
<label>密码</label>
|
||
<input type="password" name="password" class="form-control" required>
|
||
</div>
|
||
<button class="btn btn-primary w-100">登录</button>
|
||
</form>
|
||
</div>
|
||
</body>
|
||
</html>
|