Update OpenAPI, amend TS issues
This commit is contained in:
13
src/main.ts
13
src/main.ts
@@ -139,16 +139,12 @@ router.beforeEach(async (to) => {
|
||||
app.use(router);
|
||||
app.use(ToastService)
|
||||
|
||||
let apiUrl: string | undefined
|
||||
|
||||
if (!getApiUrl()) {
|
||||
apiUrl = `http://${getApiUrl()}`
|
||||
} else {
|
||||
apiUrl = "http://localhost:7070"
|
||||
}
|
||||
const devProxy = import.meta.env.DEV && !import.meta.env.VITE_API_HOST && !import.meta.env.VITE_API_PORT
|
||||
? ''
|
||||
: `http://${getApiUrl()}`
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
baseURL: apiUrl,
|
||||
baseURL: devProxy,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
@@ -173,7 +169,6 @@ axiosInstance.interceptors.response.use(
|
||||
}
|
||||
)
|
||||
|
||||
console.log(apiUrl)
|
||||
const deckService: DeckService = new DeckService(undefined, undefined, axiosInstance)
|
||||
const cardService: CardService = new CardService(undefined, undefined, axiosInstance)
|
||||
const setService: SetService = new SetService(undefined, undefined, axiosInstance)
|
||||
|
||||
Reference in New Issue
Block a user