Skip to content

Commit

Permalink
fix(env): updated envs
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Dec 9, 2022
1 parent 0c00b60 commit c7b348e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env.docker
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NODE_ENV='production'
VUE_APP_API_BASE_URL='VUE_APP_API_BASE_URL'
VUE_APP_API_BASE_URL='/api'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crawlab-ui",
"version": "0.6.0-24",
"version": "0.6.0-25",
"private": false,
"author": {
"name": "Marvin Zhang",
Expand Down
1 change: 1 addition & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare const VUE_APP_API_BASE_URL: string;
6 changes: 3 additions & 3 deletions src/utils/request.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const getRequestBaseUrl = (): string => {
return window.VUE_APP_API_BASE_URL || 'http://localhost:8000';
return process.env.VUE_APP_API_BASE_URL || 'http://localhost:8000';
};

export const getEmptyResponseWithListData = <T = any>(): ResponseWithListData<T> => {
Expand All @@ -10,11 +10,11 @@ export const getEmptyResponseWithListData = <T = any>(): ResponseWithListData<T>
};

export const downloadURI = (uri: string, name: string) => {
const link = document.createElement("a");
const link = document.createElement('a');
link.download = name;
link.href = uri;
link.click();
}
};

export const downloadData = (data: string, name: string) => {
const blob = new Blob([data], {});
Expand Down

0 comments on commit c7b348e

Please sign in to comment.