删除所有console.log输出,优化评查结果的表格的显示,添加新的页码获取逻辑

This commit is contained in:
2025-06-02 18:55:00 +08:00
parent 820baa5b22
commit b02978508d
71 changed files with 862 additions and 572 deletions
+19 -12
View File
@@ -3,7 +3,7 @@ import { useNavigate, Form } from '@remix-run/react';
import { type MetaFunction, type ActionFunctionArgs, LoaderFunctionArgs, redirect } from "@remix-run/node";
import styles from "~/styles/pages/home.css?url";
import dayjs from 'dayjs';
// import { getUserSession, logout } from "~/root";
import { getUserSession, logout } from "~/root";
export const links = () => [
{ rel: "stylesheet", href: styles }
@@ -22,22 +22,21 @@ export async function action({ request }: ActionFunctionArgs) {
const intent = formData.get("intent");
if (intent === "logout") {
// return logout(request);
return logout(request);
}
return null;
}
// 验证用户登录状态
// export async function loader({ request }: LoaderFunctionArgs) {
// const { isAuthenticated } = await getUserSession(request);
export async function loader({ request }: LoaderFunctionArgs) {
const { isAuthenticated } = await getUserSession(request);
// if (!isAuthenticated) {
// return redirect("/login");
// }
// return Response.json({ isAuthenticated });
// }
if (!isAuthenticated) {
return redirect("/login");
}
return null;
}
export default function Index() {
const navigate = useNavigate();
@@ -68,6 +67,7 @@ export default function Index() {
// 处理模块点击
const handleModuleClick = (path: string) => {
// console.log("导航到路径:", path);
navigate(path);
};
@@ -80,6 +80,13 @@ export default function Index() {
// 处理登出
const handleLogout = () => {
// 清除sessionStorage中的用户角色信息
if (typeof window !== 'undefined') {
sessionStorage.removeItem('userRole');
// 可以根据需要清除其他会话数据
sessionStorage.clear();
}
// 使用Form组件提交登出请求
const form = document.getElementById('logout-form') as HTMLFormElement;
if (form) {
@@ -127,8 +134,8 @@ export default function Index() {
{/* 合同管理模块 */}
<div
className="module-card"
onClick={() => handleModuleClick('/documents')}
onKeyDown={(e) => handleKeyDown('/documents', e)}
onClick={() => handleModuleClick('/contract-template/search')}
onKeyDown={(e) => handleKeyDown('/contract-template/search', e)}
role="button"
tabIndex={0}
aria-label="合同管理"