fix bugs
This commit is contained in:
@@ -33,12 +33,13 @@ import type {Rule} from 'ant-design-vue/es/form'
|
||||
import {useWalletStore} from "@/store/walletStore";
|
||||
import { isCashLikeDealMethod, isMainMetalWalletDealMethod, getInsufficientCashWalletMessage, getInsufficientGoldWalletMessage } from '@/utils/productDealMethod'
|
||||
import { getCashWalletBalance } from '@/utils/productAssets'
|
||||
import { persianToEnglishDigits } from '@/utils/persianDigits'
|
||||
|
||||
export const mobileValidation = (title?: string): Rule => {
|
||||
const label = title ?? 'شماره تلفن'
|
||||
return {
|
||||
validator: (_rule, value) => {
|
||||
const normalized = String(value ?? '').trim()
|
||||
const normalized = persianToEnglishDigits(String(value ?? '').trim())
|
||||
if (!normalized) {
|
||||
return Promise.resolve()
|
||||
}
|
||||
@@ -273,7 +274,7 @@ export const passwordRules = () => {
|
||||
export const englishNumberRule = () => {
|
||||
return {
|
||||
validator: (_: any, value: string | number) => {
|
||||
const str = value != null ? String(value) : ''
|
||||
const str = persianToEnglishDigits(value)
|
||||
if (!str) return Promise.resolve()
|
||||
const isEnglishDigitsOnly = /^[0-9]+$/.test(str)
|
||||
if (!isEnglishDigitsOnly) {
|
||||
|
||||
Reference in New Issue
Block a user