refine imports and styles

This commit is contained in:
AceDataCloud committed 2023-01-25 12:28:56 +08:00
1 parent f538780b91
commit c9010effbb
47 files changed
+303 -337

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
import { getEnv } from './env';
/**
* Get base url of app
* @returns
*/
export const getDataBaseUrl = () => {
const env = getEnv();
if (env === 'local') {
return 'https://data.local.zhishuyun.com';
} else if (env === 'test') {
return 'https://data.test.zhishuyun.com';
} else {
return 'https://data.zhishuyun.com';
}
};
export const getAuthBaseUrl = () => {
const env = getEnv();
if (env === 'local') {
return 'https://auth.test.zhishuyun.com';
} else if (env === 'test') {
return 'https://auth.test.zhishuyun.com';
} else {
return 'https://auth.zhishuyun.com';
}
};
+7
View File
@@ -0,0 +1,7 @@
/**
* Get env of App, return local, test, production
* @returns
*/
export const getEnv = () => {
return import.meta.env.VITE_APP_ENV;
};
+3
View File
@@ -0,0 +1,3 @@
export * from './baseUrl';
export * from './env';
export * from './mode';
+7
View File
@@ -0,0 +1,7 @@
/**
* Get mode of App, return development or production
* @returns
*/
export const getMode = () => {
return import.meta.env.MODE;
};