-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(projects): add request exception example page
- Loading branch information
1 parent
11a6a3b
commit 41e8bc4
Showing
11 changed files
with
175 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script setup lang="ts"> | ||
import { $t } from '@/locales'; | ||
import { fetchCustomBackendError } from '@/service/api'; | ||
async function logout() { | ||
await fetchCustomBackendError('8888', $t('request.logoutMsg')); | ||
} | ||
async function logoutWithModal() { | ||
await fetchCustomBackendError('7777', $t('request.logoutWithModalMsg')); | ||
} | ||
async function refreshToken() { | ||
await fetchCustomBackendError('9999', $t('request.tokenExpired')); | ||
} | ||
</script> | ||
|
||
<template> | ||
<NSpace vertical :size="16"> | ||
<NCard :title="$t('request.logout')" :bordered="false" size="small" segmented class="card-wrapper"> | ||
<NButton @click="logout">{{ $t('common.trigger') }}</NButton> | ||
</NCard> | ||
<NCard :title="$t('request.logoutWithModal')" :bordered="false" size="small" segmented class="card-wrapper"> | ||
<NButton @click="logoutWithModal">{{ $t('common.trigger') }}</NButton> | ||
</NCard> | ||
<NCard :title="$t('request.refreshToken')" :bordered="false" size="small" segmented class="card-wrapper"> | ||
<NButton @click="refreshToken">{{ $t('common.trigger') }}</NButton> | ||
</NCard> | ||
</NSpace> | ||
</template> | ||
|
||
<style scoped></style> |