fix: The forgot password page displays an error

--bug=1055073 --user=王孝刚 【长城开发科技】自定平台登录设置在点击忘记密码时还是默认提示 https://www.tapd.cn/57709429/s/1689108
This commit is contained in:
wxg0103 2025-04-23 10:05:46 +08:00
parent d6f1d25b59
commit f24337d5f3
2 changed files with 27 additions and 9 deletions

View File

@ -1,5 +1,5 @@
<template>
<login-layout>
<login-layout v-if="!loading" v-loading="loading">
<LoginContainer
:subTitle="
user.themeInfo?.slogan ? user.themeInfo?.slogan : $t('views.system.theme.defaultSlogan')
@ -69,7 +69,7 @@
</login-layout>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { onBeforeMount, ref } from 'vue'
import type { CheckCodeRequest } from '@/api/type/user'
import { useRouter } from 'vue-router'
import type { FormInstance, FormRules } from 'element-plus'
@ -80,6 +80,7 @@ import useStore from '@/stores'
const router = useRouter()
const { user } = useStore()
const CheckEmailForm = ref<CheckCodeRequest>({
email: '',
code: '',
@ -143,5 +144,11 @@ const handleTimeChange = () => {
}, 1000)
}
}
onBeforeMount(() => {
loading.value = true
user.asyncGetProfile().then(() => {
loading.value = false
})
})
</script>
<style lang="scss" scoped></style>

View File

@ -1,6 +1,10 @@
<template>
<login-layout>
<LoginContainer :subTitle="$t('views.system.theme.defaultSlogan')">
<login-layout v-if="!loading" v-loading="loading">
<LoginContainer
:subTitle="
user.themeInfo?.slogan ? user.themeInfo?.slogan : $t('views.system.theme.defaultSlogan')
"
>
<h2 class="mb-24">{{ $t('views.login.resetPassword') }}</h2>
<el-form
class="reset-password-form"
@ -35,9 +39,9 @@
</el-form-item>
</div>
</el-form>
<el-button size="large" type="primary" class="w-full" @click="resetPassword">{{
$t('common.confirm')
}}</el-button>
<el-button size="large" type="primary" class="w-full" @click="resetPassword"
>{{ $t('common.confirm') }}
</el-button>
<div class="operate-container mt-12">
<el-button
size="large"
@ -54,13 +58,15 @@
</login-layout>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { ref, onMounted, onBeforeMount } from 'vue'
import type { ResetPasswordRequest } from '@/api/type/user'
import { useRouter, useRoute } from 'vue-router'
import { MsgSuccess } from '@/utils/message'
import type { FormInstance, FormRules } from 'element-plus'
import UserApi from '@/api/user'
import { t } from '@/locales'
import useStore from '@/stores'
const { user } = useStore()
const router = useRouter()
const route = useRoute()
const {
@ -81,7 +87,12 @@ onMounted(() => {
router.push('forgot_password')
}
})
onBeforeMount(() => {
loading.value = true
user.asyncGetProfile().then(() => {
loading.value = false
})
})
const rules = ref<FormRules<ResetPasswordRequest>>({
password: [
{