mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-09 20:57:17 +08:00
fix: 修复忘记密码修改报错问题
This commit is contained in:
@@ -9,7 +9,6 @@
|
|||||||
@submit="handleLogin"
|
@submit="handleLogin"
|
||||||
>
|
>
|
||||||
<a-form-item field="email" hide-label>
|
<a-form-item field="email" hide-label>
|
||||||
<!-- <a-input v-model="form.email" placeholder="请输入邮箱" allow-clear /> -->
|
|
||||||
<a-input ref="inputRefd" v-model="form.email" placeholder="请输入邮箱" allow-clear @input="validatePhone">
|
<a-input ref="inputRefd" v-model="form.email" placeholder="请输入邮箱" allow-clear @input="validatePhone">
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<icon-email />
|
<icon-email />
|
||||||
@@ -17,7 +16,6 @@
|
|||||||
</a-input>
|
</a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item field="captcha" hide-label>
|
<a-form-item field="captcha" hide-label>
|
||||||
<!-- <a-input v-model="form.captcha" placeholder="请输入验证码" :max-length="6" allow-clear style="flex: 1 1" /> -->
|
|
||||||
<a-input v-model="form.captcha" placeholder="请输入验证码" :max-length="6" allow-clear style="flex: 1 1">
|
<a-input v-model="form.captcha" placeholder="请输入验证码" :max-length="6" allow-clear style="flex: 1 1">
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<icon-safe />
|
<icon-safe />
|
||||||
@@ -35,7 +33,6 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-space direction="vertical" fill class="w-full">
|
<a-space direction="vertical" fill class="w-full">
|
||||||
<!-- <a-button disabled class="btn" type="primary" :loading="loading" html-type="submit" size="large" long>立即登录</a-button> -->
|
|
||||||
<a-button class="btn" type="primary" :loading="loading" html-type="submit" size="large" long>立 即 登 录</a-button>
|
<a-button class="btn" type="primary" :loading="loading" html-type="submit" size="large" long>立 即 登 录</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -52,7 +49,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { type FormInstance, Message } from '@arco-design/web-vue'
|
import { type FormInstance, Message } from '@arco-design/web-vue'
|
||||||
import { type BehaviorCaptchaReq, getEmailCaptcha } from '@/apis'
|
import { type BehaviorCaptchaReq, getEmailCaptcha } from '@/apis'
|
||||||
// import { type BehaviorCaptchaReq, getEmailCaptcha } from '@/apis'
|
|
||||||
import { useTabsStore, useUserStore } from '@/stores'
|
import { useTabsStore, useUserStore } from '@/stores'
|
||||||
import * as Regexp from '@/utils/regexp'
|
import * as Regexp from '@/utils/regexp'
|
||||||
import { timeFix } from '@/utils'
|
import { timeFix } from '@/utils'
|
||||||
@@ -103,6 +99,7 @@ const onCaptcha = async () => {
|
|||||||
if (isInvalid) return
|
if (isInvalid) return
|
||||||
VerifyRef.value.show()
|
VerifyRef.value.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
const getCaptcha = async (captchaReq: BehaviorCaptchaReq) => {
|
const getCaptcha = async (captchaReq: BehaviorCaptchaReq) => {
|
||||||
if (captchaLoading.value) return
|
if (captchaLoading.value) return
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
</a-input>
|
</a-input>
|
||||||
<a-button
|
<a-button
|
||||||
class="captcha-btn" :loading="captchaLoading" :disabled="!captchaDisable" size="large"
|
class="captcha-btn" :loading="captchaLoading" :disabled="!captchaDisable" size="large"
|
||||||
@click="onCaptcha({})"
|
@click="onCaptcha"
|
||||||
>
|
>
|
||||||
{{ captchaBtnName }}
|
{{ captchaBtnName }}
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -42,6 +42,13 @@
|
|||||||
<a-button class="btn" type="primary" :loading="loading" html-type="submit" size="large" long>立 即 修 改</a-button>
|
<a-button class="btn" type="primary" :loading="loading" html-type="submit" size="large" long>立 即 修 改</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<Verify
|
||||||
|
ref="VerifyRef"
|
||||||
|
:captcha-type="captchaType"
|
||||||
|
:mode="captchaMode"
|
||||||
|
:img-size="{ width: '330px', height: '155px' }"
|
||||||
|
@success="getCaptcha"
|
||||||
|
/>
|
||||||
</a-form>
|
</a-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -75,6 +82,11 @@ const rules: FormInstance['rules'] = {
|
|||||||
captcha: [{ required: true, message: '请输入验证码' }],
|
captcha: [{ required: true, message: '请输入验证码' }],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const VerifyRef = ref<InstanceType<any>>()
|
||||||
|
const captchaType = ref('blockPuzzle')
|
||||||
|
const captchaMode = ref('pop')
|
||||||
|
const captchaLoading = ref(false)
|
||||||
|
|
||||||
const captchaTimer = ref()
|
const captchaTimer = ref()
|
||||||
const captchaTime = ref(60)
|
const captchaTime = ref(60)
|
||||||
const captchaBtnName = ref('获取验证码')
|
const captchaBtnName = ref('获取验证码')
|
||||||
@@ -94,9 +106,16 @@ const resetCaptcha = () => {
|
|||||||
captchaDisable.value = true
|
captchaDisable.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const captchaLoading = ref(false)
|
// 弹出行为验证码
|
||||||
|
const onCaptcha = async () => {
|
||||||
|
if (captchaLoading.value) return
|
||||||
|
const isInvalid = await formRef.value?.validateField('email')
|
||||||
|
if (isInvalid) return
|
||||||
|
VerifyRef.value.show()
|
||||||
|
}
|
||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
const onCaptcha = async (captchaReq: BehaviorCaptchaReq) => {
|
const getCaptcha = async (captchaReq: BehaviorCaptchaReq) => {
|
||||||
if (captchaLoading.value) return
|
if (captchaLoading.value) return
|
||||||
const isInvalid = await formRef.value?.validateField('email')
|
const isInvalid = await formRef.value?.validateField('email')
|
||||||
if (isInvalid) return
|
if (isInvalid) return
|
||||||
|
@@ -9,11 +9,6 @@
|
|||||||
@submit="handleLogin"
|
@submit="handleLogin"
|
||||||
>
|
>
|
||||||
<a-form-item field="phone" hide-label>
|
<a-form-item field="phone" hide-label>
|
||||||
<!-- <a-input v-model="form.phone" placeholder="请输入手机号" :max-length="11" allow-clear>
|
|
||||||
<template #prefix>
|
|
||||||
<icon-phone />
|
|
||||||
</template>
|
|
||||||
</a-input> -->
|
|
||||||
<a-space direction="vertical" size="mini">
|
<a-space direction="vertical" size="mini">
|
||||||
<a-input-group>
|
<a-input-group>
|
||||||
<a-select
|
<a-select
|
||||||
@@ -71,7 +66,6 @@ import { type FormInstance, Message } from '@arco-design/web-vue'
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { countryNameMap } from './code'
|
import { countryNameMap } from './code'
|
||||||
import type { BehaviorCaptchaReq } from '@/apis'
|
import type { BehaviorCaptchaReq } from '@/apis'
|
||||||
// import { type BehaviorCaptchaReq, getSmsCaptcha } from '@/apis'
|
|
||||||
import { useTabsStore, useUserStore } from '@/stores'
|
import { useTabsStore, useUserStore } from '@/stores'
|
||||||
import * as Regexp from '@/utils/regexp'
|
import * as Regexp from '@/utils/regexp'
|
||||||
import { getSmsCaptcha } from '@/apis'
|
import { getSmsCaptcha } from '@/apis'
|
||||||
@@ -143,15 +137,6 @@ const VerifyRef = ref<InstanceType<any>>()
|
|||||||
const captchaType = ref('blockPuzzle')
|
const captchaType = ref('blockPuzzle')
|
||||||
const captchaMode = ref('pop')
|
const captchaMode = ref('pop')
|
||||||
const captchaLoading = ref(false)
|
const captchaLoading = ref(false)
|
||||||
// 弹出行为验证码
|
|
||||||
const onCaptcha = async () => {
|
|
||||||
if (captchaLoading.value) return
|
|
||||||
const isInvalid = await formRef.value?.validateField('phone')
|
|
||||||
if (isInvalid) return
|
|
||||||
// 重置行为参数
|
|
||||||
VerifyRef.value.instance.refresh()
|
|
||||||
VerifyRef.value.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
const captchaTimer = ref()
|
const captchaTimer = ref()
|
||||||
const captchaTime = ref(60)
|
const captchaTime = ref(60)
|
||||||
@@ -172,8 +157,17 @@ const resetCaptcha = () => {
|
|||||||
captchaDisable.value = true
|
captchaDisable.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取验证码
|
// 弹出行为验证码
|
||||||
|
const onCaptcha = async () => {
|
||||||
|
if (captchaLoading.value) return
|
||||||
|
const isInvalid = await formRef.value?.validateField('phone')
|
||||||
|
if (isInvalid) return
|
||||||
|
// 重置行为参数
|
||||||
|
VerifyRef.value.instance.refresh()
|
||||||
|
VerifyRef.value.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取验证码
|
||||||
const getCaptcha = async (captchaReq: BehaviorCaptchaReq) => {
|
const getCaptcha = async (captchaReq: BehaviorCaptchaReq) => {
|
||||||
try {
|
try {
|
||||||
captchaLoading.value = true
|
captchaLoading.value = true
|
||||||
|
Reference in New Issue
Block a user