refine imports and styles
This commit is contained in:
1 parent
f538780b91
commit
c9010effbb
47 files changed
+303
-337
No files matched your search
@@ -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';
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Get env of App, return local, test, production
|
||||
* @returns
|
||||
*/
|
||||
export const getEnv = () => {
|
||||
return import.meta.env.VITE_APP_ENV;
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './baseUrl';
|
||||
export * from './env';
|
||||
export * from './mode';
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Get mode of App, return development or production
|
||||
* @returns
|
||||
*/
|
||||
export const getMode = () => {
|
||||
return import.meta.env.MODE;
|
||||
};
|
||||
Reference in new issue
Block a user