提交修改

This commit is contained in:
zlwu committed 2025-08-03 17:38:03 +08:00
1 parent 1e361a44ca
commit ac8a58386c
10 files changed
+765 -33

No files matched your search

+6 -6
View File
@@ -7,7 +7,7 @@ import request from '@/utils/request'
* @param expireSeconds 过期时间(秒),默认300秒
* @returns 临时访问URL
*/
export function getFileAccessUrl(ossId: number, bucketPassword?: string, expireSeconds: number = 300) {
export function getFileAccessUrl(ossId: number | string | bigint, bucketPassword?: string, expireSeconds: number = 300) {
return request({
url: `/resource/file/access/${ossId}`,
method: 'get',
@@ -44,9 +44,9 @@ export function getBatchFileAccessUrl(ossIds: number[], bucketPassword?: string,
* @param expireSeconds 过期时间(秒),默认300秒
* @returns 下载URL
*/
export function getFileDownloadUrl(ossId: number, bucketPassword?: string, expireSeconds: number = 300) {
export function getFileDownloadUrl(ossId: number | string | bigint, bucketPassword?: string, expireSeconds: number = 300) {
return request({
url: `/resource/file/download/${ossId}`,
url: `/resource/oss/download/${ossId}`,
method: 'get',
params: {
bucketPassword,
@@ -62,7 +62,7 @@ export function getFileDownloadUrl(ossId: number, bucketPassword?: string, expir
* @param expireSeconds 过期时间(秒),默认300秒
* @returns 预览URL
*/
export function getFilePreviewUrl(ossId: number, bucketPassword?: string, expireSeconds: number = 300) {
export function getFilePreviewUrl(ossId: number | string | bigint, bucketPassword?: string, expireSeconds: number = 300) {
return request({
url: `/resource/file/preview/${ossId}`,
method: 'get',
@@ -80,7 +80,7 @@ export function getFilePreviewUrl(ossId: number, bucketPassword?: string, expire
* @param bucketPassword bucket访问密码
* @returns Promise<void>
*/
export async function secureDownloadFile(ossId: number, fileName: string, bucketPassword?: string) {
export async function secureDownloadFile(ossId: number | string | bigint, fileName: string, bucketPassword?: string) {
try {
// 获取临时下载URL
const { data: downloadUrl } = await getFileDownloadUrl(ossId, bucketPassword)
@@ -119,7 +119,7 @@ export async function secureDownloadFile(ossId: number, fileName: string, bucket
* @param bucketPassword bucket访问密码
* @returns Promise<string> 预览URL
*/
export async function securePreviewFile(ossId: number, contentType?: string, bucketPassword?: string) {
export async function securePreviewFile(ossId: number | string | bigint, contentType?: string, bucketPassword?: string) {
try {
// 获取临时预览URL
const { data: previewUrl } = await getFilePreviewUrl(ossId, bucketPassword)