feat(auth): 集成认证授权功能并优化API客户端
- 实现了完整的登录注册认证流程,包括密码验证和用户资料获取 - 集成了JWT令牌管理和自动刷新机制,支持设备ID生成和管理 - 添加了WebSocket连接配置和API基础URL环境变量设置 - 实现了API客户端的请求拦截器,包括令牌验证和错误处理逻辑 - 集成了MD5加密和认证令牌缓存机制,提升安全性 - 添加了多语言国际化支持,包括英语、中文、马来语和印尼语 - 实现了认证状态管理和本地存储持久化功能 - 添加了表单验证schema和错误处理机制,增强用户体验
This commit is contained in:
@@ -1,33 +1,36 @@
|
||||
import { useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import lengthBlueBtn from '@/assets/system/length-blue-btn.webp'
|
||||
import { CenterModal } from '@/components/center-modal.tsx'
|
||||
import { SmartBackground } from '@/components/smart-background.tsx'
|
||||
import { Input } from '@/components/ui/input.tsx'
|
||||
import { Switch } from '@/components/ui/switch.tsx'
|
||||
import { useModalStore } from '@/store'
|
||||
|
||||
const AUTO_STOP_ROWS = [
|
||||
{
|
||||
label: 'Stop if balance lower than',
|
||||
labelKey: 'game.modals.autoSetting.rows.stopIfBalanceLowerThan',
|
||||
value: '0',
|
||||
checked: false,
|
||||
},
|
||||
{
|
||||
label: 'Stop if single win exceeds',
|
||||
labelKey: 'game.modals.autoSetting.rows.stopIfSingleWinExceeds',
|
||||
value: '50000',
|
||||
checked: true,
|
||||
},
|
||||
{
|
||||
label: 'Stop on any Jackpot',
|
||||
labelKey: 'game.modals.autoSetting.rows.stopOnAnyJackpot',
|
||||
// value: '50000',
|
||||
checked: false,
|
||||
},
|
||||
] as const
|
||||
|
||||
function DesktopAutoSettingModal() {
|
||||
const [open, setOpen] = useState(true)
|
||||
const { t } = useTranslation()
|
||||
const open = useModalStore((state) => state.modals.desktopAutoSetting)
|
||||
const setModalOpen = useModalStore((state) => state.setModalOpen)
|
||||
|
||||
function handleSubmit() {
|
||||
setOpen(false)
|
||||
setModalOpen('desktopAutoSetting', false)
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -36,7 +39,7 @@ function DesktopAutoSettingModal() {
|
||||
onClose={handleSubmit}
|
||||
title={
|
||||
<div className={'modal-title-glow text-design-26 uppercase'}>
|
||||
Biomond Balance
|
||||
{t('game.modals.autoSetting.title')}
|
||||
</div>
|
||||
}
|
||||
isNormalBg={true}
|
||||
@@ -51,7 +54,7 @@ function DesktopAutoSettingModal() {
|
||||
<div className={'flex w-full flex-col gap-design-26'}>
|
||||
{AUTO_STOP_ROWS.map((row) => (
|
||||
<div
|
||||
key={row.label}
|
||||
key={row.labelKey}
|
||||
className={'flex items-center justify-between gap-design-30'}
|
||||
>
|
||||
<div
|
||||
@@ -59,10 +62,10 @@ function DesktopAutoSettingModal() {
|
||||
'w-design-300 shrink-0 text-design-22 leading-[1.1] text-[#9CF7FF]'
|
||||
}
|
||||
>
|
||||
{row.label}
|
||||
{t(row.labelKey)}
|
||||
</div>
|
||||
|
||||
{row.value ? (
|
||||
{'value' in row ? (
|
||||
<div
|
||||
className={
|
||||
'game-setting-input-shell flex h-design-58 w-design-410 items-center justify-between pl-design-18 pr-design-10'
|
||||
@@ -95,7 +98,7 @@ function DesktopAutoSettingModal() {
|
||||
'w-design-300 h-design-72 pb-design-4 flex items-center justify-center text-design-24 font-bold tracking-wide text-[#E7FBFF]'
|
||||
}
|
||||
>
|
||||
START AUTO-SPIN
|
||||
{t('game.modals.autoSetting.startAutoSpin')}
|
||||
</SmartBackground>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user