feat: 初始化

This commit is contained in:
dengtongyu committed 2023-04-18 20:02:38 +08:00
commit ef8081b838
64 files changed
+2137

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
export declare const appName: string;
export declare const passid: string;
export declare const VITE_APP_ENV: string;
export declare let proxyTarget: string;
export declare const vconsoleDebug: boolean;
export declare const scriptSrcStr: string;
export declare let temp: string;
export declare const injectScriptStr: string;
+33
View File
@@ -0,0 +1,33 @@
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 = "http://apibeta.haloapp.vip";
break;
default:
proxyTarget = "http://apibeta.haloapp.vip";
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
};