diff --git a/src/apis/system/file.ts b/src/apis/system/file.ts index 6c5a739..48c5510 100644 --- a/src/apis/system/file.ts +++ b/src/apis/system/file.ts @@ -32,5 +32,5 @@ export function checkFile(sha256: string) { /** @desc 创建文件夹 */ export function createDir(path: string, name: string) { - return http.post(`${BASE_URL}/createDir`, { parentPath: path, name }) + return http.post(`${BASE_URL}/dir`, { path, originalName: name }) } diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts index e4487fa..a487cd0 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -202,24 +202,25 @@ export interface NoticePageQuery extends NoticeQuery, PageQuery { export interface FileItem { id: string name: string + originalName: string size: number url: string - parentPath: string - absPath: string - metadata: string + path: string sha256: string contentType: string + metadata: string thumbnailSize: number - thumbnailUrl: string + thumbnailName: string thumbnailMetadata: string + thumbnailUrl: string extension: string type: number storageId: string storageName: string createUserString: string createTime: string - updateUserString: string - updateTime: string + updateUserString?: string + updateTime?: string } /** 文件资源统计信息 */ export interface FileStatisticsResp { @@ -230,9 +231,9 @@ export interface FileStatisticsResp { data: Array } export interface FileQuery { - name?: string + originalName?: string type?: string - absPath?: string + path?: string sort: Array } export interface FilePageQuery extends FileQuery, PageQuery { diff --git a/src/views/system/config/storage/StorageAddModal.vue b/src/views/system/config/storage/StorageAddModal.vue index dd1e294..09d67aa 100644 --- a/src/views/system/config/storage/StorageAddModal.vue +++ b/src/views/system/config/storage/StorageAddModal.vue @@ -101,7 +101,7 @@ const columns: ColumnItem[] = reactive([ field: 'domain', type: 'input', span: 24, - required: true, + required: false, show: () => form.type === 2, }, { diff --git a/src/views/system/file/components/FileAudioModal/ModalContent.vue b/src/views/system/file/components/FileAudioModal/ModalContent.vue index 0531ebc..196d949 100644 --- a/src/views/system/file/components/FileAudioModal/ModalContent.vue +++ b/src/views/system/file/components/FileAudioModal/ModalContent.vue @@ -5,7 +5,7 @@
- {{ props.data?.name }}.{{ props.data?.extension }} + {{ props.data?.originalName }}
diff --git a/src/views/system/file/components/FileDetailModal/ModalContent.vue b/src/views/system/file/components/FileDetailModal/ModalContent.vue index a38c006..a23c652 100644 --- a/src/views/system/file/components/FileDetailModal/ModalContent.vue +++ b/src/views/system/file/components/FileDetailModal/ModalContent.vue @@ -9,14 +9,19 @@ - {{ getFileName(data) }} + {{ data.originalName }} {{ formatFileSize(data.size) }} - {{ data.absPath + getFileName(data) }} - {{ data.sha256 }} + {{ `${data.path === '/' ? '' : data.path}/${data.name}` }} + + + + {{ data.sha256 }} + + {{ data.createTime }} - {{ data.updateTime }} + {{ data?.updateTime }} {{ data.storageName }} @@ -32,11 +37,6 @@ interface Props { } withDefaults(defineProps(), {}) - -// 文件名称带后缀 -const getFileName = (item: FileItem) => { - return `${item.name}${item.extension ? `.${item.extension}` : ''}` -}