Handy_Cao 1 year ago
parent
commit
f14afe1bcb

+ 15 - 4
src/packages/pc/views/account/holdsign/components/sign/index.vue

@@ -33,16 +33,19 @@
 </template>
 
 <script lang="ts" setup>
-import { ref } from 'vue'
+import { ref, shallowRef } from 'vue'
 import { ElMessage, FormInstance, FormRules, ElMessageBox } from 'element-plus'
 import { useDoYJFGetWithholdSignInSMSVCode, useDoYJF_WithholdSignInSMS } from '@/business/bank'
 import { validateRules } from '@/constants/regex'
 import { useDateRange } from '@/hooks/date-picker'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
-import { i18n } from '@/stores'
+import { i18n, useUserStore } from '@/stores'
 
 const { t } = i18n.global
 
+const { getSystemParamValue } = useUserStore()
+const system_1010 = shallowRef(getSystemParamValue('1010') ?? '1')
+
 const { formData, onSubmit, loading, bankaccountno } = useDoYJFGetWithholdSignInSMSVCode()
 const { formData: signFormData, onSubmit: onSignSubmit } = useDoYJF_WithholdSignInSMS()
 
@@ -67,9 +70,17 @@ const formRules: FormRules = {
     Lxdh: [{
         message: '请输入手机号码',
         validator: (rule, value, callback) => {
-            if (validateRules.phone.validate(value)) {
-                callback()
+            /// 值为”0“ 时 只校验长度20位,不限字符
+            if (system_1010.value === '0') {
+                if (value.length <= 20) {
+                    callback()
+                }
+                callback(new Error(t('banksign.tips6')))
             } else {
+                /// 不存在或值为空或”1“时,根据国内手机号校验11位
+                if (validateRules.phone.validate(value)) {
+                    callback()
+                }
                 callback(new Error(validateRules.phone.message))
             }
         }

+ 17 - 5
src/packages/pc/views/auth/forget/index.vue

@@ -28,13 +28,13 @@
 </template>
 
 <script lang="ts" setup>
-import { reactive, ref } from 'vue'
+import { reactive, ref, shallowRef } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { getEncryptMobile } from '@/filters'
 import { validateRules } from '@/constants/regex'
 import { queryLoginId } from '@/services/api/account'
 import { resetPassword, sendResetVerifyCode } from '@/services/api/common'
-import { i18n } from '@/stores'
+import { i18n, useUserStore } from '@/stores'
 import cryptojs from 'crypto-js'
 import service from '@/services'
 
@@ -44,6 +44,9 @@ const seconds = ref(60) //倒计时剩余时间
 const isCountdown = ref(false) // 是否正在倒计时
 const { t } = i18n.global
 
+const { getSystemParamValue } = useUserStore()
+const system_1010 = shallowRef(getSystemParamValue('1010') ?? '1')
+
 // 表单数据
 const formData = reactive<Model.ResetPasswordReq & { confirmpassword: string }>({
     logincode: '',
@@ -58,10 +61,19 @@ const formRules: FormRules = {
     mobile: [{
         required: true,
         validator: (rule, value, callback) => {
-            if (value && validateRules.phone.validate(value)) {
-                callback()
+            /// 值为”0“ 时 只校验长度20位,不限字符
+            if (system_1010.value === '0') {
+                if (value.length <= 20) {
+                    callback()
+                }
+                callback(new Error(t('banksign.tips6')))
+            } else {
+                /// 不存在或值为空或”1“时,根据国内手机号校验11位
+                if (validateRules.phone.validate(value)) {
+                    callback()
+                }
+                callback(new Error(validateRules.phone.message))
             }
-            callback(new Error(validateRules.phone.message))
         }
     }],
     password: [{