Docker Build and Push / build-image (push) Failing after 3m51s
需求 142 条 (T-*), 设计见 docs/V0.2/任务模块/ 数据层: - 新增 6 张表: Project / ProjectMember / BoardColumn / Task / TaskMember / TaskTag - 看板列是实体(可增删改排序), Task.columnId 外键 RESTRICT 防误删列丢任务 - Task.status(todo/doing/done) 与 columnId 双落库, 二者正交 领域层 server/task-domain/ (唯一口径, 前后端不重复实现): - resolveStatus: 列决定状态(只看目标列, 无拖出回退); 状态与列不匹配时按列序取第一个绑定该状态的列自动归位, 无匹配列则不移动; 子任务完全豁免 - retention: 逐列 6 档保留窗口(永不显示/当天/3天/本周/本月/永久显示), 以 doneAt 判定 - copyTask: 跨项目深拷贝, 人员按目标项目成员过滤并回报丢弃名单 接口: /api/projects, /api/columns, /api/tasks (均校验项目成员) 前端: - 底部 Tab 插入「任务」, 位于「打卡」之后; 默认首页仍为打卡 - 列表视图(子任务缩进+折叠) / 看板视图(长按拖拽换列、拖到卡片降为子任务) - 列设置(列管理+状态绑定+保留选项) / 任务详情(扩展信息卡片默认收起) / 成员管理 - 视图记忆与上次项目存设备端 已验证: 95 文件语法 0 错误、相对导入 0 缺失、领域逻辑用例全部通过
53 lines
2.3 KiB
React
53 lines
2.3 KiB
React
import { Routes, Route, Navigate, useLocation } from 'react-router-dom'
|
|
import MobileShell from './layouts/MobileShell.jsx'
|
|
import LoginPage from './pages/LoginPage.jsx'
|
|
import MacroPage from './pages/MacroPage.jsx'
|
|
import MonitorPage from './pages/MonitorPage.jsx'
|
|
import ServerDetail from './pages/monitor/ServerDetail.jsx'
|
|
import MePage from './pages/MePage.jsx'
|
|
import CheckinPage from './pages/checkin/CheckinPage.jsx'
|
|
import TaskPage from './pages/task/TaskPage.jsx'
|
|
import { useAuth } from './auth/AuthContext.jsx'
|
|
|
|
// 默认落地页: 打卡 (V0.2 起打卡是第一个 Tab 且为默认选中)
|
|
const HOME_PATH = '/checkin'
|
|
|
|
// 已登录访问 /login 自动回默认页
|
|
function RedirectIfAuthed({ children }) {
|
|
const { user, loading } = useAuth()
|
|
if (loading) return null
|
|
if (user) return <Navigate to={HOME_PATH} replace />
|
|
return children
|
|
}
|
|
|
|
// 未登录访问受保护页面 → 跳 /login
|
|
function RequireAuth({ children }) {
|
|
const { user, loading } = useAuth()
|
|
const location = useLocation()
|
|
if (loading) return <div className="page-loading">加载中...</div>
|
|
if (!user) return <Navigate to="/login" state={{ from: location }} replace />
|
|
return children
|
|
}
|
|
|
|
export default function App() {
|
|
return (
|
|
<Routes>
|
|
<Route path="/login" element={<RedirectIfAuthed><LoginPage /></RedirectIfAuthed>} />
|
|
<Route element={<RequireAuth><MobileShell /></RequireAuth>}>
|
|
{/* 打卡为默认首页 */}
|
|
<Route path="/" element={<Navigate to={HOME_PATH} replace />} />
|
|
<Route path="/checkin" element={<CheckinPage />} />
|
|
{/* 任务模块 (V0.2): 项目列表 / 项目内列表+看板 (T-PM-06) */}
|
|
<Route path="/task" element={<TaskPage />} />
|
|
<Route path="/task/:pid" element={<TaskPage />} />
|
|
{/* 宏观: 报警 / 新闻 / 油价 / 经济数据 / 策略研究 / 经济文章 (V0.2 原首页并入, 默认新闻) */}
|
|
<Route path="/macro" element={<Navigate to="/macro/news" replace />} />
|
|
<Route path="/macro/*" element={<MacroPage />} />
|
|
<Route path="/monitor" element={<MonitorPage />} />
|
|
<Route path="/monitor/server/:uuid" element={<ServerDetail />} />
|
|
<Route path="/me" element={<MePage />} />
|
|
</Route>
|
|
<Route path="*" element={<Navigate to={HOME_PATH} replace />} />
|
|
</Routes>
|
|
)
|
|
} |