关键改动: - 增加版本表单、发布校验和调研方向进度规则 - 扩展小宝预警已读状态、风险签名和今日证据 - 补充组长权限、加班查看范围、活动记录与相关测试 Co-Authored-By: Codex GPT-5 <codex@openai.com>
32 lines
728 B
TypeScript
32 lines
728 B
TypeScript
import { api } from './api';
|
|
|
|
export type ServerDataKey =
|
|
| 'products-overview'
|
|
| 'requirements'
|
|
| 'version-plans'
|
|
| 'dev-tasks'
|
|
| 'test-cases'
|
|
| 'bugs'
|
|
| 'members'
|
|
| 'task-categories'
|
|
| 'task-worklogs'
|
|
| 'work-activities'
|
|
| 'xiaobao-risk-insights'
|
|
| 'xiaobao-risk-snapshots'
|
|
| 'xiaobao-warning-views'
|
|
| 'overtime';
|
|
|
|
interface ServerDataResponse<T> {
|
|
key: ServerDataKey;
|
|
value: T | null;
|
|
}
|
|
|
|
export async function loadServerData<T>(key: ServerDataKey): Promise<T | null> {
|
|
const res = await api.get<ServerDataResponse<T>>(`/data/${key}`);
|
|
return res.value;
|
|
}
|
|
|
|
export async function saveServerData<T>(key: ServerDataKey, value: T): Promise<void> {
|
|
await api.put(`/data/${key}`, { value });
|
|
}
|