Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix local dev #222

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ src/sunmao/**/*.yaml

.yalc
yalc.lock
.env
5 changes: 3 additions & 2 deletions packages/refine/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
13 changes: 8 additions & 5 deletions packages/refine/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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,
},
Expand Down
Loading