feat: 忘记密码/修改密码 + 设置页结构重组 + barrel cleanup + LoginPage 版本统一

新增:
  - ForgotPasswordModal — 手机号+短信验证码重置密码 (AuthAPI.resetPassword)
  - ChangePasswordModal — 当前密码验证后修改密码 (AuthAPI.changePassword)
  - useSmsCooldown Hook — 通用短信发送冷却逻辑,供注册/忘记密码复用
  - PasswordSetting — 设置页账号安全区块,双选项:修改密码 / 短信验证码重置

  修改:
  - LoginForm \"忘记密码?\" 链接接入 ForgotPasswordModal(替换 TODO)
  - LoginPage 移除 edition 业务版本 UI 区分,登录/注册 Tab 全局统一
  - 设置页 Section 组件移入 blocks/ 子目录(git mv 保留历史)
  - auth.ts sendSms URL 修正: /sms/send → /send-sms

  清理:
  - settings/index.ts 移除 4 个未使用 re-export,精简为仅 SettingsPage
  - navbar/index.ts 移除未使用 re-export,精简为仅 NavBar

  文档:
  - WORKLOG.md 新增 2026-06-08 工作日志
  - ARCHITECTURE.md / PROJECT.md 更新设置页目录结构与新组件
  - TODO.md 忘记密码流程标记已完成 + 短信人机验证列入后期优化
This commit is contained in:
2026-06-08 11:57:35 +08:00
parent 952a723448
commit 7032d1c3f2
22 changed files with 1089 additions and 515 deletions

View File

@@ -0,0 +1,65 @@
// ============================================================
// SystemInfoSetting — 系统信息区块(只读展示)
// ============================================================
import { Card, Tag, Typography } from 'antd';
import {
WindowsOutlined,
AppleOutlined,
InfoCircleOutlined,
EnvironmentOutlined,
} from '@ant-design/icons';
import { useAppContext } from '@/contexts/app-context';
import { getPlatformName } from '@/utils/platform';
import { APP_VERSION } from '@shared/constants/version';
import { getEditionName } from '@shared/constants/app';
const { Text } = Typography;
export function SystemInfoSetting() {
const { platform, edition, isDevMode } = useAppContext();
const platformIcon =
platform === 'darwin' ? (
<AppleOutlined />
) : platform === 'win32' ? (
<WindowsOutlined />
) : (
<InfoCircleOutlined />
);
const infoItems = [
{ label: '运行平台', value: getPlatformName(), icon: platformIcon, color: 'purple' },
{ label: '应用版本', value: `V${APP_VERSION}`, icon: <InfoCircleOutlined />, color: 'blue' },
{
label: '版本类型',
value: getEditionName(edition),
icon: <InfoCircleOutlined />,
color: edition === 'enterprise' ? 'gold' : 'green',
},
{
label: '运行环境',
value: isDevMode ? '开发模式' : '生产模式',
icon: <EnvironmentOutlined />,
color: isDevMode ? 'orange' : 'green',
},
];
return (
<Card size="small" title="系统信息" className="rounded-md!">
<div className="flex flex-col gap-2">
{infoItems.map((item) => (
<div key={item.label} className="flex items-center gap-2">
<span style={{ color: 'var(--color-primary, #4F46E5)', fontSize: 14 }}>
{item.icon}
</span>
<Text type="secondary" className="text-sm min-w-[64px]">
{item.label}
</Text>
<Tag color={item.color}>{item.value}</Tag>
</div>
))}
</div>
</Card>
);
}