fix: ensure page refresh to login page upon logout (#465)

This commit is contained in:
sagit
2026-04-23 20:43:27 +08:00
committed by GitHub
parent db25ba2cbe
commit 1d08a1ccfc
+2 -1
View File
@@ -2,8 +2,9 @@ import { clearSession } from "@/utils/session";
/**
* 安全退出登录函数
* 清除登录相关数据,但保留用户偏好设置(如主题)
* 清除登录相关数据,并强制刷新跳转到首页
*/
export const safeLogout = () => {
clearSession();
window.location.href = "/";
};