You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
518 B
20 lines
518 B
2 years ago
|
import { UploadApiResult } from './model/uploadModel'
|
||
|
import { defHttp } from '@/utils/http/axios'
|
||
|
import { UploadFileParams } from '@/types/axios'
|
||
|
import { useGlobSetting } from '@/hooks/setting'
|
||
|
|
||
|
const { uploadUrl = '' } = useGlobSetting()
|
||
|
|
||
|
/**
|
||
|
* @description: Upload interface
|
||
|
*/
|
||
|
export function uploadApi(params: UploadFileParams, onUploadProgress: (progressEvent: ProgressEvent) => void) {
|
||
|
return defHttp.uploadFile<UploadApiResult>(
|
||
|
{
|
||
|
url: uploadUrl,
|
||
|
onUploadProgress
|
||
|
},
|
||
|
params
|
||
|
)
|
||
|
}
|