mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-06 08:09:24 +00:00
fix: route issue without env file (#598)
This commit is contained in:
@@ -21,14 +21,7 @@ import config from "../aws-exports";
|
||||
const http = () => {
|
||||
const instance = axios.create({
|
||||
// timeout: 10000,
|
||||
baseURL:
|
||||
(import.meta.env.VITE_ZINCOBSERVE_ENDPOINT &&
|
||||
import.meta.env.VITE_ZINCOBSERVE_ENDPOINT.endsWith("/")
|
||||
? import.meta.env.VITE_ZINCOBSERVE_ENDPOINT.slice(0, -1)
|
||||
: import.meta.env.VITE_ZINCOBSERVE_ENDPOINT) ||
|
||||
(window.location.origin != "http://localhost:8081"
|
||||
? window.location.origin
|
||||
: "http://localhost:5080"),
|
||||
baseURL: store.state.API_ENDPOINT,
|
||||
headers: {
|
||||
Authorization:
|
||||
config.isZincObserveCloud == "true"
|
||||
|
||||
+10
-10
@@ -15,16 +15,16 @@
|
||||
import { createStore } from "vuex";
|
||||
import { useLocalOrganization, useLocalCurrentUser } from "../utils/zincutils";
|
||||
|
||||
const API_ENDPOINT =
|
||||
import.meta.env.VITE_ZINCOBSERVE_CLOUD &&
|
||||
import.meta.env.VITE_ZINCOBSERVE_CLOUD == "true"
|
||||
? import.meta.env.VITE_ZINCOBSERVE_ENDPOINT &&
|
||||
import.meta.env.VITE_ZINCOBSERVE_ENDPOINT.endsWith("/")
|
||||
? import.meta.env.VITE_ZINCOBSERVE_ENDPOINT.slice(0, -1)
|
||||
: import.meta.env.VITE_ZINCOBSERVE_ENDPOINT
|
||||
: window.location.origin != "http://localhost:8081"
|
||||
? window.location.origin
|
||||
: "http://localhost:5080";
|
||||
const pos = window.location.pathname.indexOf("/web/");
|
||||
const API_ENDPOINT = import.meta.env.VITE_ZINCOBSERVE_ENDPOINT
|
||||
? import.meta.env.VITE_ZINCOBSERVE_ENDPOINT.endsWith("/")
|
||||
? import.meta.env.VITE_ZINCOBSERVE_ENDPOINT.slice(0, -1)
|
||||
: import.meta.env.VITE_ZINCOBSERVE_ENDPOINT
|
||||
: window.location.origin == "http://localhost:8081"
|
||||
? "/"
|
||||
: pos > -1
|
||||
? window.location.pathname.slice(0, pos)
|
||||
: window.location.pathname;
|
||||
|
||||
export default createStore({
|
||||
state: {
|
||||
|
||||
Reference in New Issue
Block a user