Merge branch 'master' into preview
This commit is contained in:
commit
aea361719f
2 changed files with 5 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "sink",
|
"name": "sink",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@9.7.1",
|
"packageManager": "pnpm@9.7.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,10 @@ export function useAPI(api: string, options?: object): Promise<unknown> {
|
||||||
Authorization: `Bearer ${localStorage.getItem('SinkSiteToken') || ''}`,
|
Authorization: `Bearer ${localStorage.getItem('SinkSiteToken') || ''}`,
|
||||||
},
|
},
|
||||||
})).catch((error) => {
|
})).catch((error) => {
|
||||||
|
if (error?.status === 401) {
|
||||||
|
localStorage.removeItem('SinkSiteToken')
|
||||||
|
navigateTo('/dashboard/login')
|
||||||
|
}
|
||||||
if (error?.data?.statusMessage) {
|
if (error?.data?.statusMessage) {
|
||||||
toast(error?.data?.statusMessage)
|
toast(error?.data?.statusMessage)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue