|
|
@@ -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: [{
|