fix: logout problem

This commit is contained in:
shinya
2025-07-03 19:00:42 +08:00
parent 480b38a5c5
commit 6e7bbf2d5a
2 changed files with 1 additions and 8 deletions

View File

@@ -40,10 +40,6 @@
"api": "https://wolongzyw.com/api.php/provide/vod",
"name": "卧龙资源"
},
"hwba": {
"api": "https://cjhwba.com/api.php/provide/vod",
"name": "华为吧资源"
},
"jisu": {
"api": "https://jszyapi.com/api.php/provide/vod",
"name": "极速资源",

View File

@@ -3,7 +3,6 @@
'use client';
import { LogOut } from 'lucide-react';
import { useRouter } from 'next/navigation';
/**
* 退出登录按钮
@@ -13,15 +12,13 @@ import { useRouter } from 'next/navigation';
* 2. 跳转到 /login 页面
*/
export function LogoutButton() {
const router = useRouter();
const handleLogout = () => {
if (typeof window !== 'undefined') {
localStorage.removeItem('username');
localStorage.removeItem('password');
}
// 使用 replace避免用户返回上一页时仍然处于已登录状态
router.replace('/login');
window.location.reload();
};
return (