新增功能

This commit is contained in:
Your Name
2026-03-24 16:32:56 +08:00
parent 250d173c2f
commit 9160c36735
248 changed files with 3063 additions and 250 deletions
+22
View File
@@ -26,6 +26,28 @@ export async function uploadImageBlob(file: Blob, filename = 'screenshot.jpg') {
return json.data as { id: number; uri: string; url: string }
}
/** 本地上传视频(管理端 /upload/video),返回 data 含 uri 完整访问地址、url 相对路径 */
export async function uploadVideoBlob(file: Blob, filename = 'recording.webm') {
const appStore = useAppStore()
const formData = new FormData()
formData.append('file', file, filename)
formData.append('cid', '0')
const url = `${config.baseUrl}${config.urlPrefix}/upload/video`
const res = await fetch(url, {
method: 'POST',
headers: {
token: getToken() || '',
version: appStore.config.version || ''
},
body: formData
})
const json = await res.json()
if (json.code !== RequestCodeEnum.SUCCESS) {
throw new Error(json.msg || '上传失败')
}
return json.data as { id: number; uri: string; url: string }
}
export function fileCateAdd(params: Record<string, any>) {
return request.post({ url: '/file/addCate', params })
}