mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-11-20 16:47:53 +00:00
Merge branch 'master' of gitlab.prodcontest.ru:team-15/project
This commit is contained in:
commit
97ebd36b8c
2 files changed
+2
-2
No files matched your search
@@ -0,0 +1 @@
|
||||
VITE_API_ENDPOINT="/api/v1"
|
||||
@@ -3,8 +3,6 @@ import { getToken, removeToken } from "../token";
|
||||
|
||||
const BASE_URL = import.meta.env.VITE_API_ENDPOINT;
|
||||
|
||||
console.log(import.meta.env.VITE_API_ENDPOINT);
|
||||
|
||||
export class ApiError extends Error {
|
||||
response: Response;
|
||||
status: number;
|
||||
@@ -26,6 +24,7 @@ export const authFetch = ofetch.create({
|
||||
export const apiFetch = ofetch.create({
|
||||
baseURL: BASE_URL,
|
||||
async onRequest({ options }) {
|
||||
console.log(import.meta.env.VITE_API_ENDPOINT);
|
||||
options.headers.set("Authorization", "Bearer " + getToken());
|
||||
},
|
||||
async onResponseError({ response }) {
|
||||
|
||||
Reference in new issue
Block a user