增加环境变量VITE_OUT_URL

This commit is contained in:
2026-03-12 15:16:18 +08:00
parent 1cd7a43bc5
commit f269c42a58
5 changed files with 13 additions and 4 deletions
+5 -3
View File
@@ -41,9 +41,11 @@
import { getAllParentPath } from '/@/router/helper/menuHelper';
import { usePermission } from '/@/hooks/web/usePermission';
import { defHttp } from '/@/utils/http/axios';
import { getEnvInfo } from '/@/utils/getEnv';
// import { getEnvInfo } from '/@/utils/getEnv';
import { getToken } from '/@/utils/auth';
import { useLoading } from '/@/components/Loading';
import { useGlobSetting } from '/@/hooks/setting';
const { viteOutUrl } = useGlobSetting();
export default defineComponent({
name: 'BasicMenu',
@@ -128,7 +130,7 @@
async function handleMenuClick({ item, key }: { item: any; key: string; keyPath: string[] }) {
if (item.title === '健康银行') {
open();
const url = getEnvInfo().VITE_GLOB_API_URL;
const url = viteOutUrl;
await defHttp
.get({
url: '/health-system/api/sys/encryptInfo',
@@ -142,7 +144,7 @@
})
.then((res) => {
console.log(res);
window.open(`${getEnvInfo().VITE_OUT_URL}${res.encryptData}`, '_blank');
window.open(`${viteOutUrl}${res.encryptData}`, '_blank');
close();
})
.catch(() => {
+2
View File
@@ -17,6 +17,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
VITE_GLOB_ONLINE_VIEW_URL,
VITE_GLOB_ST_DOMAIN_URL,
VITE_PLATFORM,
VITE_OUT_URL,
} = getAppEnvConfig();
if (!/[a-zA-Z\_]*/.test(VITE_GLOB_APP_SHORT_NAME)) {
@@ -40,6 +41,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
viewUrl: VITE_GLOB_ONLINE_VIEW_URL,
stDomainUrl: VITE_GLOB_ST_DOMAIN_URL,
vitePlatform: VITE_PLATFORM,
viteOutUrl: VITE_OUT_URL,
};
window._CONFIG['domianURL'] = VITE_GLOB_DOMAIN_URL;
return glob as Readonly<GlobConfig>;
+2
View File
@@ -34,6 +34,7 @@ export function getAppEnvConfig() {
VITE_GLOB_ONLINE_VIEW_URL,
VITE_GLOB_ST_DOMAIN_URL,
VITE_PLATFORM,
VITE_OUT_URL,
} = ENV;
if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
// warn(
@@ -55,6 +56,7 @@ export function getAppEnvConfig() {
VITE_GLOB_ONLINE_VIEW_URL,
VITE_GLOB_ST_DOMAIN_URL,
VITE_PLATFORM,
VITE_OUT_URL,
};
}