fix: 补充缺失代码导致的打包异常

This commit is contained in:
TsMask
2023-12-04 19:06:08 +08:00
parent d64c0f9e5e
commit fb45c3fc10
3 changed files with 27 additions and 9 deletions

View File

@@ -1,14 +1,15 @@
<script lang="ts" setup>
import { GlobalFooter } from 'antdv-pro-layout';
import { Modal, message } from 'ant-design-vue/lib';
import { onMounted, reactive, toRaw } from 'vue';
import { computed, onMounted, reactive, toRaw } from 'vue';
import { register } from '@/api/login';
import { regExpPasswd, regExpUserName } from '@/utils/regular-utils';
import { useRouter, useRoute } from 'vue-router';
import useAppStore from '@/store/modules/app';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
const { t } = useI18n();
import { parseUrlPath } from '@/plugins/file-static-url';
const { t, currentLocale } = useI18n();
const router = useRouter();
const route = useRoute();
const appStore = useAppStore();
@@ -70,6 +71,22 @@ function fnFinish() {
});
}
// LOGO地址
const logoUrl = computed(() => {
let url =
appStore.logoType === 'brand'
? parseUrlPath(appStore.filePathBrand)
: parseUrlPath(appStore.filePathIcon);
if (url.indexOf('{language}') === -1) {
return url;
}
// 语言参数替换
const local = currentLocale.value;
const lang = local.split('_')[0];
return url.replace('{language}', lang);
});
/**
* 国际化翻译转换
*/
@@ -92,11 +109,11 @@ onMounted(() => {
<div class="header">
<a href="/" target="_self">
<template v-if="appStore.logoType === 'icon'">
<img :src="appStore.getLOGOIcon" class="logo" alt="logo" />
<img :src="logoUrl" class="logo" alt="logo" />
<span class="title">{{ appStore.appName }}</span>
</template>
<template v-if="appStore.logoType === 'brand'">
<img :src="appStore.getLOGOBrand" class="logo" alt="logo" />
<img :src="logoUrl" class="logo" alt="logo" />
</template>
</a>
</div>
@@ -205,7 +222,6 @@ onMounted(() => {
width: 100%;
min-height: 100%;
padding: 110px 0 144px;
background-image: url(../assets/background.svg);
background-repeat: no-repeat;
background-position: center 110px;
background-size: 100%;

View File

@@ -9,6 +9,7 @@ import { uploadFile } from '@/api/tool/file';
import { FileType } from 'ant-design-vue/lib/upload/interface';
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
import { sessionGet } from '@/utils/cache-session-utils';
import { parseUrlPath } from '@/plugins/file-static-url';
const appStore = useAppStore();
const { t } = useI18n();
@@ -84,7 +85,7 @@ function fnEdit(v: boolean) {
state.edite = v;
if (!v) {
state.filePath = '#';
state.flag = appStore.getLoginBackground;
state.flag = parseUrlPath(appStore.loginBackground);
}
}
@@ -142,8 +143,8 @@ function fnRevert() {
}
onMounted(() => {
state.filePath = appStore.getLoginBackground;
state.flag = appStore.getLoginBackground;
state.filePath = parseUrlPath(appStore.loginBackground);
state.flag = parseUrlPath(appStore.loginBackground);
});
</script>

View File

@@ -6,13 +6,14 @@ import { useRoute } from 'vue-router';
import { VuePDF, usePDF } from '@tato30/vue-pdf';
import '@tato30/vue-pdf/style.css';
import saveAs from 'file-saver';
import { parseUrlPath } from '@/plugins/file-static-url';
const { t, currentLocale } = useI18n();
const appStore = useAppStore();
const route = useRoute();
// 文档地址
const docUrl = computed(() => {
let url = appStore.getHelpDoc;
let url = parseUrlPath(appStore.helpDoc);
if (url.indexOf('{language}') === -1) {
return url;
}