Skip to content

Commit f24337d

Browse files
committed
fix: The forgot password page displays an error
--bug=1055073 --user=王孝刚 【长城开发科技】自定平台登录设置在点击忘记密码时还是默认提示 https://www.tapd.cn/57709429/s/1689108
1 parent d6f1d25 commit f24337d

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

ui/src/views/login/forgot-password/index.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<login-layout>
2+
<login-layout v-if="!loading" v-loading="loading">
33
<LoginContainer
44
:subTitle="
55
user.themeInfo?.slogan ? user.themeInfo?.slogan : $t('views.system.theme.defaultSlogan')
@@ -69,7 +69,7 @@
6969
</login-layout>
7070
</template>
7171
<script setup lang="ts">
72-
import { ref } from 'vue'
72+
import { onBeforeMount, ref } from 'vue'
7373
import type { CheckCodeRequest } from '@/api/type/user'
7474
import { useRouter } from 'vue-router'
7575
import type { FormInstance, FormRules } from 'element-plus'
@@ -80,6 +80,7 @@ import useStore from '@/stores'
8080
8181
const router = useRouter()
8282
const { user } = useStore()
83+
8384
const CheckEmailForm = ref<CheckCodeRequest>({
8485
email: '',
8586
code: '',
@@ -143,5 +144,11 @@ const handleTimeChange = () => {
143144
}, 1000)
144145
}
145146
}
147+
onBeforeMount(() => {
148+
loading.value = true
149+
user.asyncGetProfile().then(() => {
150+
loading.value = false
151+
})
152+
})
146153
</script>
147154
<style lang="scss" scoped></style>

ui/src/views/login/reset-password/index.vue

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<template>
2-
<login-layout>
3-
<LoginContainer :subTitle="$t('views.system.theme.defaultSlogan')">
2+
<login-layout v-if="!loading" v-loading="loading">
3+
<LoginContainer
4+
:subTitle="
5+
user.themeInfo?.slogan ? user.themeInfo?.slogan : $t('views.system.theme.defaultSlogan')
6+
"
7+
>
48
<h2 class="mb-24">{{ $t('views.login.resetPassword') }}</h2>
59
<el-form
610
class="reset-password-form"
@@ -35,9 +39,9 @@
3539
</el-form-item>
3640
</div>
3741
</el-form>
38-
<el-button size="large" type="primary" class="w-full" @click="resetPassword">{{
39-
$t('common.confirm')
40-
}}</el-button>
42+
<el-button size="large" type="primary" class="w-full" @click="resetPassword"
43+
>{{ $t('common.confirm') }}
44+
</el-button>
4145
<div class="operate-container mt-12">
4246
<el-button
4347
size="large"
@@ -54,13 +58,15 @@
5458
</login-layout>
5559
</template>
5660
<script setup lang="ts">
57-
import { ref, onMounted } from 'vue'
61+
import { ref, onMounted, onBeforeMount } from 'vue'
5862
import type { ResetPasswordRequest } from '@/api/type/user'
5963
import { useRouter, useRoute } from 'vue-router'
6064
import { MsgSuccess } from '@/utils/message'
6165
import type { FormInstance, FormRules } from 'element-plus'
6266
import UserApi from '@/api/user'
6367
import { t } from '@/locales'
68+
import useStore from '@/stores'
69+
const { user } = useStore()
6470
const router = useRouter()
6571
const route = useRoute()
6672
const {
@@ -81,7 +87,12 @@ onMounted(() => {
8187
router.push('forgot_password')
8288
}
8389
})
84-
90+
onBeforeMount(() => {
91+
loading.value = true
92+
user.asyncGetProfile().then(() => {
93+
loading.value = false
94+
})
95+
})
8596
const rules = ref<FormRules<ResetPasswordRequest>>({
8697
password: [
8798
{

0 commit comments

Comments
 (0)