refactor: oss下载 重构为浏览器原生下载(非阻塞)

This commit is contained in:
dap
2025-08-13 10:07:38 +08:00
parent 9eb9fef430
commit a17618423c
3 changed files with 63 additions and 24 deletions

View File

@@ -65,6 +65,20 @@ export function ossDownload(
});
}
/**
* 在使用浏览器原生下载前检测是否登录
* 这里的方案为请求一次接口 如果登录超时会走到response的401逻辑
* 如果没有listByIds的权限 也不会弹出无权限提示
* 仅仅是为了检测token是否有效使用
*
* @returns void
*/
export function checkLoginBeforeDownload() {
return requestClient.get<OssFile[]>(`${Api.ossInfo}/1`, {
errorMessageMode: 'none',
});
}
/**
* 删除文件
* @param ossIds id数组