mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-11-10 02:57:12 +08:00
feat: 新增文件管理
This commit is contained in:
@@ -18,3 +18,8 @@ export function listRoleDict(query?: { name: string; status: number }) {
|
||||
export function listCommonDict(code: string) {
|
||||
return http.get<LabelValueState[]>(`${BASE_URL}/dict/${code}`)
|
||||
}
|
||||
|
||||
/** @desc 上传文件 */
|
||||
export function uploadFile(data: FormData) {
|
||||
return http.post(`${BASE_URL}/file`, data)
|
||||
}
|
||||
19
src/apis/system/file.ts
Normal file
19
src/apis/system/file.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import http from '@/utils/http'
|
||||
import type * as System from './type'
|
||||
|
||||
const BASE_URL = '/system/file'
|
||||
|
||||
/** @desc 查询文件列表 */
|
||||
export function listFile(query: System.FileQuery) {
|
||||
return http.get<System.FileItem[]>(`${BASE_URL}/list`, query)
|
||||
}
|
||||
|
||||
/** @desc 修改文件 */
|
||||
export function updateFile(data: any, id: string) {
|
||||
return http.put(`${BASE_URL}/${id}`, data)
|
||||
}
|
||||
|
||||
/** @desc 删除文件 */
|
||||
export function deleteFile(ids: string | Array<string>) {
|
||||
return http.del(`${BASE_URL}/${ids}`)
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
export * from './dept'
|
||||
export * from './log'
|
||||
export * from './dict'
|
||||
export * from './file'
|
||||
export * from './storage'
|
||||
|
||||
@@ -91,6 +91,25 @@ export interface DictItemQuery extends PageQuery {
|
||||
dictId: string
|
||||
}
|
||||
|
||||
/** 系统文件类型 */
|
||||
export type FileItem = {
|
||||
id: string
|
||||
name: string
|
||||
size: number
|
||||
url: string
|
||||
extension: string
|
||||
type: number
|
||||
storageId: string
|
||||
createUserString: string
|
||||
createTime: string
|
||||
updateUserString: string
|
||||
updateTime: string
|
||||
}
|
||||
export interface FileQuery extends PageQuery {
|
||||
name?: string
|
||||
type?: string
|
||||
}
|
||||
|
||||
/** 系统存储类型 */
|
||||
export type StorageResp = {
|
||||
id: string
|
||||
|
||||
Reference in New Issue
Block a user