mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 23:17:09 +00:00
fix
This commit is contained in:
@@ -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