feat: team page

This commit is contained in:
2024-11-14 17:58:19 +07:00
parent 7a00992ff9
commit 71dfbd5db3
23 changed files with 790 additions and 67 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { getCurrentServer } from "@/stores/app";
import authStore from "@/stores/auth";
import authStore, { logout } from "@/stores/auth";
import { ofetch } from "ofetch";
const api = ofetch.create({
@@ -23,7 +23,7 @@ const api = ofetch.create({
},
onResponseError: (error) => {
if (error.response.status === 401 && !!authStore.getState().token) {
authStore.setState({ token: null });
logout();
throw new Error("Unauthorized");
}