fix(auth): 解决认证错误处理和会话管理问题
- 替换 AUTH_INVALID_TOKEN_CODE 为 AUTH_RELOGIN_REQUIRED_CODES 数组支持多种错误码 - 实现 hasClearableSessionState 和 hasRecordedUnauthorizedSession 函数优化会话清理逻辑 - 添加 clearQueryCache 选项控制查询缓存清理行为 - 修复马来西亚手机号正则验证模式导致的用户名验证问题 - 更新 API 错误消息处理优先级,优先使用服务端返回的消息 - 添加服务器消息检查函数 hasServerMessage 避免重复错误提示 - 在登录表单中实现密码可见性切换功能 - 添加密码可见性国际化文案支持 - 实现页面历史记录抽屉组件和相关动效 - 优化模态框背景遮罩样式和键盘事件处理 - 调整多个组件的 z-index 层级避免显示冲突
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
const malaysiaMobilePhonePattern = /^60\d{1,9}$/
|
||||
|
||||
const usernameSchema = z
|
||||
.string()
|
||||
.trim()
|
||||
.min(1, 'auth.validation.username.required')
|
||||
.regex(malaysiaMobilePhonePattern, 'auth.validation.username.invalidPhone')
|
||||
|
||||
const passwordSchema = z
|
||||
.string()
|
||||
|
||||
Reference in New Issue
Block a user