Files
paidui-wechat/config/index.ts
T
2023-04-21 01:08:58 +08:00

33 lines
1012 B
TypeScript

const appName = "金币充值";
const ENV: any = import.meta.env || process.env;
const VITE_APP_ENV: string = ENV.VITE_APP_ENV;
let proxyTarget = "";
switch (VITE_APP_ENV) {
case "test":
proxyTarget = "http://apibeta.haloapp.vip";
break;
case "prod":
proxyTarget = "https://api.xingyuwenhua.com.cn";
break;
default:
proxyTarget = "http://api.xingyuwenhua.com.cn";
break;
}
const vconsoleDebug = true;
const scriptSrcStr = "var src = '/midjs/mjs/vconsole/v3.14.6/vconsole.min.js';document.write('<scr' + 'ipt src=\"' + src + '\"></scr' + 'ipt>');document.write('<scr' + 'ipt>new window.VConsole();</scr' + 'ipt>');";
let temp = "";
if (vconsoleDebug && (VITE_APP_ENV === "test" || VITE_APP_ENV === "uat")) {
temp = scriptSrcStr;
} else {
temp = `if (/vconsole=true/.test(window.location)) {${scriptSrcStr}};`;
}
const injectScriptStr = `<script>;(function () {${temp}})();</script>`;
export {
appName,
proxyTarget,
injectScriptStr
};