Files
pj_mini_app_cloud/src/sheep/utils/app.ts
T

24 lines
543 B
TypeScript

import { APPENV } from "../constant"
export const isDevEnv = (): boolean => process.env.NODE_ENV === "development"
export const getBaseApiUrl = () => {
let baseApiUrl = ""
if (isDevEnv()) {
baseApiUrl = import.meta.env.VITE_APP_DEV_SERVICE
} else {
baseApiUrl = import.meta.env.VITE_APP_PROD_SERVICE
}
return baseApiUrl
}
export type AppEnvValue = (typeof APPENV)[keyof typeof APPENV]
export const getAppInfo = async (): Promise<AppEnvValue> => {
return APPENV.WECHAT
}
export const getLaunchParam = () => {
return "canteen"
}