fix(pages): redirect to homepage if user isn't found from api
This commit is contained in:
parent
40bb98eb1d
commit
09762a7efb
@ -10,7 +10,7 @@
|
||||
const { data: ses } = useAuth();
|
||||
|
||||
const { data: userInfo } = await useApiFetch<IUser | null>(`/user/${rtr.params.id}`);
|
||||
if (userInfo === null) {
|
||||
if (userInfo.value === null) {
|
||||
navigateTo("/");
|
||||
}
|
||||
const activeKey = ref("main");
|
||||
@ -49,9 +49,9 @@
|
||||
</div>
|
||||
<div v-else>
|
||||
<span>
|
||||
{{ format(uLastVisit, "MM/dd/yyyy @ hh:mm:ss a") }}
|
||||
{{ format(userInfo.lastVisit, "MM/dd/yyyy @ hh:mm:ss a") }}
|
||||
</span>
|
||||
<span style="margin-left: 0.6em"> ({{ formatDistanceToNow(uLastVisit, { addSuffix: true }) }}) </span>
|
||||
<span style="margin-left: 0.6em"> ({{ formatDistanceToNow(userInfo.lastVisit, { addSuffix: true }) }}) </span>
|
||||
</div>
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="Website">
|
||||
|
Loading…
x
Reference in New Issue
Block a user