fix: use completeRegistration for incomplete OTP setup in login flow

- LoginPage: call completeRegistration instead of verifyOTP when qrCodeURL exists
- This ensures otp_verified is set to true for users completing OTP setup
- Backend: reorder maxUsers check to allow existing incomplete users to continue
- Backend: return OTP info when login with incomplete OTP setup
This commit is contained in:
tinkle-community
2026-01-07 20:15:27 +08:00
parent 138943d6fb
commit e92222950a
12 changed files with 477 additions and 310 deletions

View File

@@ -98,7 +98,6 @@ export function AdvancedChart({
symbol = 'BTCUSDT',
interval = '5m',
traderID,
height = 550,
exchange = 'binance', // 默认使用 binance
onSymbolChange: _onSymbolChange, // Available for future use
}: AdvancedChartProps) {
@@ -347,7 +346,7 @@ export function AdvancedChart({
const chart = createChart(chartContainerRef.current, {
width: chartContainerRef.current.clientWidth,
height: height,
height: chartContainerRef.current.clientHeight, // Use container height
layout: {
background: { color: '#0B0E11' },
textColor: '#B7BDC6',
@@ -447,16 +446,16 @@ export function AdvancedChart({
})
volumeSeriesRef.current = volumeSeries as any
// 响应式调整
const handleResize = () => {
if (chartContainerRef.current && chartRef.current) {
chartRef.current.applyOptions({
width: chartContainerRef.current.clientWidth,
})
}
}
// 响应式调整 (ResizeObserver)
const resizeObserver = new ResizeObserver((entries) => {
if (entries.length === 0 || !entries[0].contentRect) return
const { width, height } = entries[0].contentRect
chart.applyOptions({ width, height })
})
window.addEventListener('resize', handleResize)
if (chartContainerRef.current) {
resizeObserver.observe(chartContainerRef.current)
}
// 监听鼠标移动,显示 OHLC 信息
chart.subscribeCrosshairMove((param) => {
@@ -490,10 +489,11 @@ export function AdvancedChart({
})
return () => {
window.removeEventListener('resize', handleResize)
resizeObserver.disconnect()
chart.remove()
}
}, [height])
}, []) // Removed [height] dependency as we now autosize
// 加载数据和指标
useEffect(() => {