Skip to content

Commit

Permalink
fix: 代码优化 TencentBlueKing#1570
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 3919
  • Loading branch information
yuri0528 committed Mar 15, 2024
1 parent 36833a2 commit 2c49e20
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/pages/src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ import HeaderBox from './views/Header.vue';
import { currentUser } from '@/http/api';
import { t } from '@/language/index';
import { useUser } from '@/store/user';
import ResetPassword from '@/views/reset-password/index.vue';
import Password from '@/views/reset-password/index.vue';
import ResetPassword from '@/views/reset-password/newPassword.vue';
const route = useRoute();
const showPassword = ref(false);
const showName = ref(null);
// 判断是否是重置密码的路由
watch(() => route.name, (val) => {
if (val === 'password' || val === 'resetPassword') {
showPassword.value = true;
showName.value = val;
} else {
initUser();
}
Expand Down Expand Up @@ -44,16 +45,17 @@ const initUser = async () => {

<template>
<div>
<Password v-if="showName === 'password'" />
<ResetPassword v-else-if="showName === 'resetPassword'" />
<bk-loading
v-if="!showPassword"
v-else
:loading="isLoading"
:class="{
'main-loading': isLoading
}"
>
<HeaderBox v-if="!isLoading" />
</bk-loading>
<ResetPassword v-else />
</div>
</template>

Expand Down

0 comments on commit 2c49e20

Please sign in to comment.