aaa
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { AccountSendVerifyCode, AccountVerifyCode, AccountResetPassword } from '@/api/account'
|
||||
import md5 from 'md5'
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { validateEmail, validatePass } from './tools'
|
||||
@@ -103,22 +104,12 @@
|
||||
const onSubmit1 = () => {
|
||||
form1Ref.value?.validate?.((valid) => {
|
||||
if (valid) {
|
||||
index.value = 1
|
||||
} else {
|
||||
console.warn('error submit!')
|
||||
}
|
||||
})
|
||||
}
|
||||
const onSubmit2 = () => {
|
||||
form2Ref.value?.validate?.((valid) => {
|
||||
if (valid) {
|
||||
const data = {
|
||||
AccountSendVerifyCode({
|
||||
email: formData.email,
|
||||
code: formData.code,
|
||||
password: md5(formData.password)
|
||||
}
|
||||
console.log(data)
|
||||
emit('back')
|
||||
operationType: 'FORGOT_PWD'
|
||||
}).then(() => {
|
||||
index.value = 1
|
||||
})
|
||||
} else {
|
||||
console.warn('error submit!')
|
||||
}
|
||||
@@ -126,8 +117,30 @@
|
||||
}
|
||||
const onVerifyCode = (code: string) => {
|
||||
if (!code) return
|
||||
formData.code = code
|
||||
index.value = 2
|
||||
AccountVerifyCode({
|
||||
email: formData.email,
|
||||
emailVerifyCode: code,
|
||||
operationType: 'FORGOT_PWD'
|
||||
}).then(() => {
|
||||
formData.code = code
|
||||
index.value = 2
|
||||
})
|
||||
}
|
||||
const onSubmit2 = () => {
|
||||
form2Ref.value?.validate?.((valid) => {
|
||||
if (valid) {
|
||||
const data = {
|
||||
email: formData.email,
|
||||
password: md5(formData.password),
|
||||
emailVerifyCode: formData.code
|
||||
}
|
||||
AccountResetPassword(data).then(() => {
|
||||
emit('back')
|
||||
})
|
||||
} else {
|
||||
console.warn('error submit!')
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import img from '@/assets/images/brand-null.png'
|
||||
let data = reactive({
|
||||
})
|
||||
const router = useRouter()
|
||||
const isShoppingShow = ref(true)
|
||||
const isShoppingShow = ref(false)
|
||||
const shoppingClose = () => {
|
||||
isShoppingShow.value = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user