oss 直传

分片上传
This commit is contained in:
2026-05-08 10:49:16 +08:00
parent 4dc9ec1878
commit 7d7a4aa4d2
26 changed files with 1644 additions and 72 deletions
+47
View File
@@ -90,3 +90,50 @@ export function fileMove(params: Record<string, any>) {
export function fileRename(params: { id: number; name: string }) {
return request.post({ url: '/file/rename', params })
}
/** 浏览器直传 OSS - 凭证类型 */
export interface OssCredentialsResponse {
provider: string
fallback: boolean
bucket?: string
region?: string
host?: string
cdn_domain?: string
key_prefix?: string
max_size?: number
duration?: number
expired_time?: number
start_time?: number
credentials?: {
tmpSecretId: string
tmpSecretKey: string
sessionToken: string
}
}
/** 申请 STS 临时凭证 */
export function getOssCredentials(params: { type: 'video' }) {
return request.post({
url: '/upload/ossCredentials',
params
}) as Promise<OssCredentialsResponse>
}
/** 直传完成回执:写 file 表 + HEAD 校验 */
export function confirmOssUpload(params: {
type: 'video'
key: string
name: string
size: number
content_type: string
cid?: number
}) {
return request.post({ url: '/upload/ossConfirm', params }) as Promise<{
id: number
cid: number
type: number
name: string
uri: string
url: string
}>
}
+13 -2
View File
@@ -229,14 +229,25 @@ export function startCloudRecording(params: { diagnosis_id: number }) {
return request.post({ url: '/tcm.diagnosis/startCloudRecording', params })
}
/** 本地录制完成后,将已上传视频的访问地址写入通话记录(忽略取消令牌,避免与其它 POST 互斥取消 */
export function attachLocalCallRecording(params: { diagnosis_id: number; file_url: string }) {
/** 本地录制完成后,将已上传视频的访问地址写入通话记录(可显式传 call_record_id */
export function attachLocalCallRecording(params: {
diagnosis_id: number
file_url: string
call_record_id?: number
}) {
return request.post(
{ url: '/tcm.diagnosis/attachLocalCallRecording', params },
{ ignoreCancelToken: true, isOpenRetry: false }
)
}
export function createManualCallRecord(params: { diagnosis_id: number }) {
return request.post(
{ url: '/tcm.diagnosis/createManualCallRecord', params },
{ ignoreCancelToken: true, isOpenRetry: false }
)
}
/** 医助旁观当前进行中的视频通话(进房参数,Web TRTC 只拉流) */
export function getAssistantWatchCallParams(params: { diagnosis_id: number }) {
return request.get({ url: '/tcm.diagnosis/watchCall', params })