diff --git a/.gitignore b/.gitignore index 8469deb..ec51885 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ src/sunmao/**/*.yaml .yalc yalc.lock +.env diff --git a/packages/refine/src/App.tsx b/packages/refine/src/App.tsx index aa95166..5faa6b7 100644 --- a/packages/refine/src/App.tsx +++ b/packages/refine/src/App.tsx @@ -155,10 +155,11 @@ function App() { }, []); const globalStore = useMemo(() => { + const clusterName = import.meta.env.VITE_CLUSTER_NAME || 'clusterName'; return new GlobalStore( { - apiUrl: '/api/sks-proxy/api/v1/clusters/obs/proxy', - watchWsApiUrl: 'api/sks-ws/sks-proxy/api/v1/clusters/obs/proxy', + apiUrl: `/api/sks-proxy/api/v1/clusters/${clusterName}/proxy`, + watchWsApiUrl: `api/sks-ws/sks-proxy/api/v1/clusters/${clusterName}/proxy`, prefix: 'default', plugins: ProviderPlugins, }, diff --git a/packages/refine/vite.config.ts b/packages/refine/vite.config.ts index d3187ad..1338e6a 100644 --- a/packages/refine/vite.config.ts +++ b/packages/refine/vite.config.ts @@ -24,9 +24,10 @@ export default defineConfig({ '/api': { target: process.env.API_HOST || 'http://192.168.30.67', ws: true, - headers: { - 'x-skip-auth-verify': 'true', - 'Accept-Encoding': 'identity' + headers: { + 'Accept-Encoding': 'identity', + 'Authorization': process.env.REACT_APP_DEV_TOKEN, + 'Cookie': process.env.REACT_APP_DEV_COOKIE, }, secure: false, }, @@ -36,8 +37,10 @@ export default defineConfig({ return path.replace('/exec-proxy', ''); }, ws: true, - headers: { - Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4IiwiaWF0IjoxNzE3NDk0OTIxfQ.GPW3AWxK1zqirbCP4OQJZ4VoDmLXLLgDjR_EjFcsqHQ', + headers: { + 'Accept-Encoding': 'identity', + 'Authorization': process.env.REACT_APP_DEV_TOKEN, + 'Cookie': process.env.REACT_APP_DEV_COOKIE, }, secure: false, },