From cd53fab1f9d4455c242596a858ea97927320513c Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 12 Dec 2023 19:29:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E4=BB=B6=E8=BD=AC=E5=AD=98?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=A7=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 16 ++-------------- src/api/tool/file.ts | 12 ++++++++++++ .../setting/components/change-help-doc.vue | 3 +-- .../system/setting/components/change-logo.vue | 3 +-- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 50ac53d4..42843ee4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -62,8 +62,8 @@ export async function listMain() { //通过sort进行冒泡排序 mergedData.sort((a: any, b: any) => { - const typeA = specificOrder.indexOf(a.name.split("_")[0]); - const typeB = specificOrder.indexOf(b.name.split("_")[0]); + const typeA = specificOrder.indexOf(a.name.split('_')[0]); + const typeB = specificOrder.indexOf(b.name.split('_')[0]); if (typeA === -1) return 1; // 如果不在特定顺序中,排到后面 if (typeB === -1) return -1; // 如果不在特定顺序中,排到后面 return typeA - typeB; @@ -102,15 +102,3 @@ export function getSysConf() { method: 'get', }); } - -/** - * 转存上传文件到静态资源 - * @returns object - */ -export function transferStaticFile(data: Record) { - return request({ - url: `/transferStaticFile`, - method: 'post', - data, - }); -} diff --git a/src/api/tool/file.ts b/src/api/tool/file.ts index 8ffe4982..8f1f8b94 100644 --- a/src/api/tool/file.ts +++ b/src/api/tool/file.ts @@ -199,6 +199,18 @@ export function chunkUpload(data: FormData) { }); } +/** + * 转存上传文件到静态资源 + * @returns object + */ +export function transferStaticFile(data: Record) { + return request({ + url: `/file/transferStaticFile`, + method: 'post', + data, + }); +} + /** * 上传切片文件并发送文件到网元端 * @param neType 网元类型, UPF diff --git a/src/views/system/setting/components/change-help-doc.vue b/src/views/system/setting/components/change-help-doc.vue index 5794565c..20b1cbe3 100644 --- a/src/views/system/setting/components/change-help-doc.vue +++ b/src/views/system/setting/components/change-help-doc.vue @@ -4,8 +4,7 @@ import { onMounted, reactive } from 'vue'; import useAppStore from '@/store/modules/app'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; -import { transferStaticFile } from '@/api/index'; -import { uploadFileChunk } from '@/api/tool/file'; +import { transferStaticFile, uploadFileChunk } from '@/api/tool/file'; import { FileType } from 'ant-design-vue/lib/upload/interface'; import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; import { useRouter } from 'vue-router'; diff --git a/src/views/system/setting/components/change-logo.vue b/src/views/system/setting/components/change-logo.vue index 698156b3..2adf955f 100644 --- a/src/views/system/setting/components/change-logo.vue +++ b/src/views/system/setting/components/change-logo.vue @@ -7,10 +7,9 @@ import { onMounted, reactive, watch, computed } from 'vue'; import useAppStore from '@/store/modules/app'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; -import { uploadFile } from '@/api/tool/file'; +import { transferStaticFile, uploadFile } from '@/api/tool/file'; import { changeValue } from '@/api/system/config'; import { sessionGet } from '@/utils/cache-session-utils'; -import { transferStaticFile } from '@/api'; import { parseUrlPath } from '@/plugins/file-static-url'; const appStore = useAppStore(); const { t, currentLocale, optionsLocale } = useI18n();