feat(client): login page

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2025-12-24 19:37:39 +08:00
committed by Asai Neko
parent 3e9656db23
commit 634c922903
18 changed files with 594 additions and 32 deletions

View File

@@ -1,5 +1,6 @@
import type { AxiosError } from 'axios';
import axios from 'axios';
import { router } from '@/lib/router';
export const axiosClient = axios.create({
baseURL: '/api/',
@@ -16,6 +17,7 @@ axiosClient.interceptors.request.use((config) => {
axiosClient.interceptors.response.use(undefined, async (error: AxiosError) => {
if (error.response && error?.response.status === 401) {
// TODO: refresh token
await router.navigate({ to: '/login' });
if (error.config) {
return axiosClient(error.config);
}