Files
leonapp/admin/logout.php
Leonmmcoset c1d45e256a refactor(ui): 替换CDN资源为本地文件并统一按钮样式
- 将Font Awesome从CDN引用改为本地文件/css/all.min.css
- 为所有按钮添加图标以提升用户体验
- 修复登出弹窗的DOM加载问题
- 更新config.php中的数据库和SMTP配置
2025-07-16 22:02:47 +08:00

37 lines
899 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
require_once '../config.php';
session_start();
// 销毁所有会话变量
$_SESSION = [];
// 如果使用了基于cookie的会话也需要删除cookie
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(
session_name(),
'',
time() - 42000,
$params["path"],
$params["domain"],
$params["secure"],
$params["httponly"]
);
}
// 销毁会话
session_destroy();
// 使用Sweet Alert弹窗提示并跳转登录页
echo '<script src="/js/sweetalert.js"></script>';
echo '<script>document.addEventListener("DOMContentLoaded", function() {
Swal.fire({
title: "登出成功",
text: "您已安全登出系统",
icon: "success",
timer: 1500,
showConfirmButton: false,
target: document.body
}).then(() => { window.location.href = "login.php"; });
});</script>';
exit();