修改需要打包导出的变量名

This commit is contained in:
yangjiewei
2025-06-05 17:57:37 +08:00
parent e41d0a44ed
commit 488cba91b5
11 changed files with 165 additions and 158 deletions

View File

@ -17,7 +17,9 @@ VITE_DROP_CONSOLE = false
# 接口地址 # 接口地址
# 如果没有跨域问题,直接在这里配置即可 # 如果没有跨域问题,直接在这里配置即可
VITE_GLOB_API_URL=http://10.133.96.105:8077 VITE_GLOB_API_URL=http://10.133.96.137:8090
# VITE_GLOB_API_URL=http://10.4.126.67:30000
# VITE_GLOB_API_URL=http://10.0.252.25:8090
#VITE_GLOB_REQUEST_TIMEOUT=20000 #VITE_GLOB_REQUEST_TIMEOUT=20000
# 报表系统地址 # 报表系统地址
VITE_GLOB_REPORT_URL=http://10.133.96.105:3100 VITE_GLOB_REPORT_URL=http://10.133.96.105:3100
@ -38,8 +40,8 @@ VITE_GLOB_PRINT_BASE_URL = http://114.116.210.204:3300
VITE_GLOB_API_URL_PREFIX = VITE_GLOB_API_URL_PREFIX =
#租户开关 #租户开关
# VITE_TENANT_ENABLED = true # VITE_GLOB_TENANT_ENABLED = true
# 屏蔽通知消息的轮询 # 屏蔽通知消息的轮询
VITE_DISABLE_NEWS=false VITE_GLOB_DISABLE_NEWS=false
# 禁用关闭页面提示 # 禁用关闭页面提示
# VITE_CLOSE_ALERT_DISABLED=true # VITE_GLOB_CLOSE_ALERT_DISABLED=true

View File

@ -35,4 +35,4 @@ VITE_GLOB_PRINT_BASE_URL = http://114.116.210.204:3300
VITE_GLOB_API_URL_PREFIX = VITE_GLOB_API_URL_PREFIX =
# 屏蔽通知消息的轮询 # 屏蔽通知消息的轮询
VITE_DISABLE_NEWS = true VITE_GLOB_DISABLE_NEWS = true

View File

@ -37,4 +37,8 @@ VITE_GLOB_API_URL_PREFIX =
# 打包是否开启pwa功能 # 打包是否开启pwa功能
VITE_USE_PWA = false VITE_USE_PWA = false
#租户开关 #租户开关
VITE_TENANT_ENABLED = true VITE_GLOB_TENANT_ENABLED = true
# 屏蔽通知消息的轮询
VITE_GLOB_DISABLE_NEWS=false
# 禁用关闭页面提示
# VITE_GLOB_CLOSE_ALERT_DISABLED=true

280
.vscode/settings.json vendored
View File

@ -1,144 +1,142 @@
{ {
"typescript.tsdk": "./node_modules/typescript/lib", "typescript.tsdk": "./node_modules/typescript/lib",
"volar.tsPlugin": true, "volar.tsPlugin": true,
"volar.tsPluginStatus": false, "volar.tsPluginStatus": false,
"npm.packageManager": "pnpm", "npm.packageManager": "pnpm",
"editor.tabSize": 2, "editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode",
"files.eol": "\n", "files.eol": "\n",
"search.exclude": { "search.exclude": {
"**/node_modules": true, "**/node_modules": true,
"**/*.log": true, "**/*.log": true,
"**/*.log*": true, "**/*.log*": true,
"**/bower_components": true, "**/bower_components": true,
"**/dist": true, "**/dist": true,
"**/elehukouben": true, "**/elehukouben": true,
"**/.git": true, "**/.git": true,
"**/.gitignore": true, "**/.gitignore": true,
"**/.svn": true, "**/.svn": true,
"**/.DS_Store": true, "**/.DS_Store": true,
"**/.idea": true, "**/.idea": true,
"**/.vscode": false, "**/.vscode": false,
"**/yarn.lock": true, "**/yarn.lock": true,
"**/tmp": true, "**/tmp": true,
"out": true, "out": true,
"dist": true, "dist": true,
"node_modules": true, "node_modules": true,
"CHANGELOG.md": true, "CHANGELOG.md": true,
"examples": true, "examples": true,
"res": true, "res": true,
"screenshots": true, "screenshots": true,
"yarn-error.log": true, "yarn-error.log": true,
"**/.yarn": true "**/.yarn": true
},
"files.exclude": {
"**/.cache": true,
"**/.editorconfig": true,
"**/.eslintcache": true,
"**/bower_components": true,
"**/.idea": true,
"**/tmp": true,
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/.vscode/**": true,
"**/node_modules/**": true,
"**/tmp/**": true,
"**/bower_components/**": true,
"**/dist/**": true,
"**/yarn.lock": true
},
"stylelint.enable": true,
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"],
"path-intellisense.mappings": {
"/@/": "${workspaceRoot}/src"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[vue]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
}, },
"editor.defaultFormatter": "esbenp.prettier-vscode" "files.exclude": {
}, "**/.cache": true,
"i18n-ally.localesPaths": ["src/locales/lang"], "**/.editorconfig": true,
"i18n-ally.keystyle": "nested", "**/.eslintcache": true,
"i18n-ally.sortKeys": true, "**/bower_components": true,
"i18n-ally.namespace": true, "**/.idea": true,
"i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}", "**/tmp": true,
"i18n-ally.enabledParsers": ["ts"], "**/.git": true,
"i18n-ally.sourceLanguage": "en", "**/.svn": true,
"i18n-ally.displayLanguage": "zh-CN", "**/.hg": true,
"i18n-ally.enabledFrameworks": ["vue", "react"], "**/CVS": true,
"cSpell.words": [ "**/.DS_Store": true
"vben", },
"windi", "files.watcherExclude": {
"browserslist", "**/.git/objects/**": true,
"tailwindcss", "**/.git/subtree-cache/**": true,
"esnext", "**/.vscode/**": true,
"antv", "**/node_modules/**": true,
"tinymce", "**/tmp/**": true,
"qrcode", "**/bower_components/**": true,
"sider", "**/dist/**": true,
"pinia", "**/yarn.lock": true
"sider", },
"nprogress", "stylelint.enable": true,
"INTLIFY", "stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"],
"stylelint", "path-intellisense.mappings": {
"esno", "/@/": "${workspaceRoot}/src"
"vitejs", },
"sortablejs", "[javascriptreact]": {
"mockjs", "editor.defaultFormatter": "esbenp.prettier-vscode"
"codemirror", },
"iconify", "[typescript]": {
"commitlint", "editor.defaultFormatter": "esbenp.prettier-vscode"
"vditor", },
"echarts", "[typescriptreact]": {
"cropperjs", "editor.defaultFormatter": "esbenp.prettier-vscode"
"logicflow", },
"vueuse", "[html]": {
"zxcvbn", "editor.defaultFormatter": "esbenp.prettier-vscode"
"lintstagedrc", },
"brotli", "[css]": {
"tailwindcss", "editor.defaultFormatter": "esbenp.prettier-vscode"
"sider", },
"pnpm", "[less]": {
"antd" "editor.defaultFormatter": "esbenp.prettier-vscode"
], },
"files.autoSave": "onFocusChange", "[scss]": {
"editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode"
"eslint.codeActionsOnSave.rules": null, },
"vue3snippets.enable-compile-vue-file-on-did-save-code": false "[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[vue]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"i18n-ally.localesPaths": ["src/locales/lang"],
"i18n-ally.keystyle": "nested",
"i18n-ally.sortKeys": true,
"i18n-ally.namespace": true,
"i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}",
"i18n-ally.enabledParsers": ["ts"],
"i18n-ally.sourceLanguage": "en",
"i18n-ally.displayLanguage": "zh-CN",
"i18n-ally.enabledFrameworks": ["vue", "react"],
"cSpell.words": [
"vben",
"windi",
"browserslist",
"tailwindcss",
"esnext",
"antv",
"tinymce",
"qrcode",
"sider",
"pinia",
"sider",
"nprogress",
"INTLIFY",
"stylelint",
"esno",
"vitejs",
"sortablejs",
"mockjs",
"codemirror",
"iconify",
"commitlint",
"vditor",
"echarts",
"cropperjs",
"logicflow",
"vueuse",
"zxcvbn",
"lintstagedrc",
"brotli",
"tailwindcss",
"sider",
"pnpm",
"antd"
],
"eslint.codeActionsOnSave.rules": null,
"vue3snippets.enable-compile-vue-file-on-did-save-code": false
} }

View File

@ -55,7 +55,7 @@
return '关闭提示'; return '关闭提示';
}; };
if(!getAppEnvConfig().VITE_CLOSE_ALERT_DISABLED){ if(!getAppEnvConfig().VITE_GLOB_CLOSE_ALERT_DISABLED){
window.addEventListener('beforeunload', beforeUnloadHandler); window.addEventListener('beforeunload', beforeUnloadHandler);
} }

View File

@ -196,7 +196,7 @@
if (o.read) o.read = []; if (o.read) o.read = [];
}); });
try { try {
let res = import.meta.env.VITE_DISABLE_NEWS ? [] : await getOaNews(1); let res = import.meta.env.VITE_GLOB_DISABLE_NEWS ? [] : await getOaNews(1);
res.list.forEach((o) => { res.list.forEach((o) => {
if (!o.readId) listData.value[0].unreadNum += 1; if (!o.readId) listData.value[0].unreadNum += 1;
listData.value[0].list.push({ listData.value[0].list.push({
@ -210,7 +210,7 @@
read: o.isRead, read: o.isRead,
}); });
}); });
let res1 = import.meta.env.VITE_DISABLE_NEWS ? [] : await getOaNews(2); let res1 = import.meta.env.VITE_GLOB_DISABLE_NEWS ? [] : await getOaNews(2);
res1.list.forEach((o) => { res1.list.forEach((o) => {
if (!o.readId) listData.value[1].unreadNum += 1; if (!o.readId) listData.value[1].unreadNum += 1;
listData.value[1].list.push({ listData.value[1].list.push({
@ -224,7 +224,7 @@
read: o.isRead, read: o.isRead,
}); });
}); });
let res2 = import.meta.env.VITE_DISABLE_NEWS ? [] : await getOaMessage(); let res2 = import.meta.env.VITE_GLOB_DISABLE_NEWS ? [] : await getOaMessage();
res2.forEach((o) => { res2.forEach((o) => {
if (o.messageType === 0) { if (o.messageType === 0) {
if (!o.isRead) listData.value[2].unreadNum += 1; if (!o.isRead) listData.value[2].unreadNum += 1;

View File

@ -25,7 +25,7 @@
<Notify v-if="getShowNotice" :class="`${prefixCls}-action__item notify-item`" /> <Notify v-if="getShowNotice" :class="`${prefixCls}-action__item notify-item`" />
<UserTenantChange v-if="getAppEnvConfig().VITE_TENANT_ENABLED" /> <UserTenantChange v-if="getAppEnvConfig().VITE_GLOB_TENANT_ENABLED" />
<SettingDrawer v-if="getShowSetting" :class="`${prefixCls}-action__item`" ref="drawer" /> <SettingDrawer v-if="getShowSetting" :class="`${prefixCls}-action__item`" ref="drawer" />
<UserDropDown @menu-click="onMenuClick" :theme="getHeaderTheme" :show-settings="getShowSetting" /> <UserDropDown @menu-click="onMenuClick" :theme="getHeaderTheme" :show-settings="getShowSetting" />
</div> </div>

View File

@ -22,7 +22,7 @@ export function getAppEnvConfig() {
(import.meta.env as unknown as GlobEnvConfig) (import.meta.env as unknown as GlobEnvConfig)
: window[ENV_NAME as any]) as unknown as GlobEnvConfig; : window[ENV_NAME as any]) as unknown as GlobEnvConfig;
const { VITE_GLOB_APP_TITLE, VITE_GLOB_API_URL, VITE_GLOB_APP_SHORT_NAME, VITE_GLOB_API_URL_PREFIX, VITE_GLOB_REQUEST_TIMEOUT, VITE_GLOB_UPLOAD_URL, VITE_GLOB_UPLOAD_PREVIEW, VITE_GLOB_OUT_LINK_URL, VITE_GLOB_REPORT_URL, VITE_GLOB_PRINT_BASE_URL, VITE_TENANT_ENABLED } = ENV; const { VITE_GLOB_APP_TITLE, VITE_GLOB_API_URL, VITE_GLOB_APP_SHORT_NAME, VITE_GLOB_API_URL_PREFIX, VITE_GLOB_REQUEST_TIMEOUT, VITE_GLOB_UPLOAD_URL, VITE_GLOB_UPLOAD_PREVIEW, VITE_GLOB_OUT_LINK_URL, VITE_GLOB_REPORT_URL, VITE_GLOB_PRINT_BASE_URL, VITE_GLOB_TENANT_ENABLED } = ENV;
if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) { if (!/^[a-zA-Z\_]*$/.test(VITE_GLOB_APP_SHORT_NAME)) {
warn(`VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.`); warn(`VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.`);
@ -39,7 +39,7 @@ export function getAppEnvConfig() {
VITE_GLOB_OUT_LINK_URL, VITE_GLOB_OUT_LINK_URL,
VITE_GLOB_REPORT_URL, VITE_GLOB_REPORT_URL,
VITE_GLOB_PRINT_BASE_URL, VITE_GLOB_PRINT_BASE_URL,
VITE_TENANT_ENABLED VITE_GLOB_TENANT_ENABLED
}; };
} }

View File

@ -34,7 +34,7 @@
</Input> </Input>
</FormItem> </FormItem>
<FormItem v-if="getAppEnvConfig().VITE_TENANT_ENABLED && loginType =='pw'" name="tenantCode" class="enter-x"> <FormItem v-if="getAppEnvConfig().VITE_GLOB_TENANT_ENABLED && loginType =='pw'" name="tenantCode" class="enter-x">
<label class="form-title"> {{ t('租户码') }}</label> <label class="form-title"> {{ t('租户码') }}</label>
<Input <Input
size="large" size="large"
@ -458,13 +458,16 @@
:deep(.ant-input-affix-wrapper-lg) { :deep(.ant-input-affix-wrapper-lg) {
padding-left: 0; padding-left: 0;
} }
.login-modal-content { .login-modal-content {
text-align: center; text-align: center;
.refresh { .refresh {
text-align: right; text-align: right;
cursor: pointer; cursor: pointer;
} }
} }
:deep(.captcha-image) { :deep(.captcha-image) {
cursor: pointer; cursor: pointer;
border: 1px solid #ddd; border: 1px solid #ddd;

View File

@ -35,7 +35,7 @@
</InputPassword> </InputPassword>
</FormItem> </FormItem>
<FormItem v-if="getAppEnvConfig().VITE_TENANT_ENABLED" name="tenantCode" class="enter-x"> <FormItem v-if="getAppEnvConfig().VITE_GLOB_TENANT_ENABLED" name="tenantCode" class="enter-x">
<label class="form-title"> {{ t('租户码') }}</label> <label class="form-title"> {{ t('租户码') }}</label>
<Input <Input
size="large" size="large"

4
types/config.d.ts vendored
View File

@ -163,8 +163,8 @@ export interface GlobEnvConfig {
//file preview //file preview
VITE_GLOB_UPLOAD_PREVIEW?: string; VITE_GLOB_UPLOAD_PREVIEW?: string;
VITE_GLOB_REPORT_URL: string; VITE_GLOB_REPORT_URL: string;
VITE_TENANT_ENABLED: boolean; VITE_GLOB_TENANT_ENABLED: boolean;
VITE_CLOSE_ALERT_DISABLED: boolean; VITE_GLOB_CLOSE_ALERT_DISABLED: boolean;
} }
export interface LogoConfig { export interface LogoConfig {