%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
import axios from "axios"; //import util from "./util"; import AuthService from "./services/AuthService"; export const apiUrl=()=>{ let url='/'; if(window.location.href.indexOf("localhost")>=0){ url=window.location.protocol+"//"+window.location.hostname+"/pro/lms/api/"; }else{ url=window.location.protocol+"//"+window.location.hostname+"/api/"; } return url; } const axiosInstance=axios.create({ baseURL:apiUrl(), withCredentials:true }); axiosInstance.interceptors.request.use( (config)=>{ //config.headers.authorization=AuthService.getToken(); //config.headers.timezoneoffset=util.getTimezoneOffset(); return config; }, (error)=>{ return Promise.reject(error); } ); axiosInstance.interceptors.response.use( (response)=>{ return response; }, (error)=>{ if(typeof error.response === "undefined"){ error.response={}; }else{ if(typeof error.response.data === "object"){ if(typeof error.response.data?.message!== "undefined"){ error.message=error.response.data?.message; } if(error.response.data.loggedOut===1){ AuthService.logout(); } } } return Promise.reject(error); } ); export default axiosInstance;