feat: 优化账户管理和订单功能

- 重置密码后自动跳转到登录页,登录页添加重置密码入口
- 移除默认账户相关逻辑和UI
- 移除前端API Key自动获取提示文案(后端保留自动获取逻辑)
- 修复SELL订单takerAmount计算精度问题,使用精确计算避免精度丢失
- 修复导入账户页面白屏问题(缺少Alert组件导入)
- 持仓出售支持百分比模式,使用原始精度数据计算,支持小数百分比
- 优化订单金额计算逻辑,确保与SDK一致
This commit is contained in:
WrBug
2025-12-03 21:39:48 +08:00
parent 99f2d7a850
commit 2ad558da36
13 changed files with 289 additions and 259 deletions
+4 -6
View File
@@ -1,5 +1,4 @@
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { Card, Form, Input, Button, message, Typography, Alert, Progress } from 'antd'
import { LockOutlined, KeyOutlined, UserOutlined } from '@ant-design/icons'
import { apiService } from '../services/api'
@@ -52,7 +51,6 @@ const getPasswordStrengthInfo = (strength: number): { text: string; color: strin
}
const ResetPassword: React.FC = () => {
const navigate = useNavigate()
const isMobile = useMediaQuery({ maxWidth: 768 })
const [loading, setLoading] = useState(false)
const [passwordStrength, setPasswordStrength] = useState(0)
@@ -77,11 +75,11 @@ const ResetPassword: React.FC = () => {
newPassword: values.newPassword
})
if (response.data.code === 0) {
message.success('密码重置成功,请登录')
// 延迟跳转到登录页,让用户看到成功提示
message.success('密码重置成功', 1)
// 使用 window.location.href 强制跳转到登录页,确保跳转成功
setTimeout(() => {
navigate('/login', { replace: true })
}, 1000)
window.location.href = '/login'
}, 500)
} else {
message.error(response.data.msg || '密码重置失败')
}