Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/Aida_Purchaser_Front

This commit is contained in:
2026-05-21 13:44:58 +08:00
5 changed files with 150 additions and 21 deletions

View File

@@ -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>