Merge branch 'dev' of gitea.51mars.com:Oak-Team/oak-frontend-base into dev

This commit is contained in:
Xu Chang 2025-11-12 12:56:34 +08:00
commit b8e3dcd24a
15 changed files with 34 additions and 17 deletions

View File

@ -1,5 +1,6 @@
export declare class Upload {
uploadFile(file: string | File, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean): Promise<any>;
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, uploadId?: string, // 新增上传任务ID用于中断特定上传
method?: "POST" | "PUT" | "PATCH"): Promise<any>;
private controllers;
constructor();
abortUpload(uploadId: string): boolean;

View File

@ -1,5 +1,6 @@
export class Upload {
async uploadFile(file, name, uploadUrl, formData, autoInform) {
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, uploadId, // 新增上传任务ID用于中断特定上传
method = "POST") {
console.warn('server不会调用此函数');
}
controllers = new Map();

View File

@ -1,3 +1,4 @@
export declare class Upload {
uploadFile(file: string | File, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, method?: "POST" | "PUT" | "PATCH"): Promise<any>;
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, uploadId?: string, // 新增上传任务ID用于中断特定上传
method?: "POST" | "PUT" | "PATCH"): Promise<any>;
}

View File

@ -1,6 +1,7 @@
import { promisify } from './promisify';
export class Upload {
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, method = "POST") {
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, uploadId, // 新增上传任务ID用于中断特定上传
method = "POST") {
const isPut = method === "PUT";
if (isPut) {
return new Promise((resolve, reject) => {

View File

@ -1,3 +1,4 @@
export declare class Upload {
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, method?: "POST" | "PUT" | "PATCH"): Promise<any>;
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, uploadId?: string, // 新增上传任务ID用于中断特定上传
method?: "POST" | "PUT" | "PATCH"): Promise<any>;
}

View File

@ -1,5 +1,6 @@
export class Upload {
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, method = "POST") {
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, uploadId, // 新增上传任务ID用于中断特定上传
method = "POST") {
const isPut = method === "PUT";
if (isPut) {
// S3 预签名上传

View File

@ -1,5 +1,6 @@
export declare class Upload {
uploadFile(file: string | File, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean): Promise<any>;
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, uploadId?: string, // 新增上传任务ID用于中断特定上传
method?: "POST" | "PUT" | "PATCH"): Promise<any>;
private controllers;
constructor();
abortUpload(uploadId: string): boolean;

View File

@ -2,7 +2,8 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.Upload = void 0;
class Upload {
async uploadFile(file, name, uploadUrl, formData, autoInform) {
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, uploadId, // 新增上传任务ID用于中断特定上传
method = "POST") {
console.warn('server不会调用此函数');
}
controllers = new Map();

View File

@ -1,3 +1,4 @@
export declare class Upload {
uploadFile(file: string | File, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, method?: "POST" | "PUT" | "PATCH"): Promise<any>;
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, uploadId?: string, // 新增上传任务ID用于中断特定上传
method?: "POST" | "PUT" | "PATCH"): Promise<any>;
}

View File

@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.Upload = void 0;
const promisify_1 = require("./promisify");
class Upload {
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, method = "POST") {
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, uploadId, // 新增上传任务ID用于中断特定上传
method = "POST") {
const isPut = method === "PUT";
if (isPut) {
return new Promise((resolve, reject) => {

View File

@ -1,3 +1,4 @@
export declare class Upload {
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, method?: "POST" | "PUT" | "PATCH"): Promise<any>;
uploadFile(file: File | string, name: string, uploadUrl: string, formData: Record<string, any>, autoInform?: boolean, getPercent?: Function, uploadId?: string, // 新增上传任务ID用于中断特定上传
method?: "POST" | "PUT" | "PATCH"): Promise<any>;
}

View File

@ -2,7 +2,8 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.Upload = void 0;
class Upload {
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, method = "POST") {
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, uploadId, // 新增上传任务ID用于中断特定上传
method = "POST") {
const isPut = method === "PUT";
if (isPut) {
// S3 预签名上传

View File

@ -2,13 +2,14 @@ import { promisify } from './promisify';
export class Upload {
async uploadFile(
file: string | File,
file: File | string,
name: string,
uploadUrl: string,
formData: Record<string, any>,
autoInform?: boolean,
getPercent?: Function,
method: "POST" | "PUT" | "PATCH" = "POST"
uploadId?: string, // 新增上传任务ID用于中断特定上传
method: "POST" | "PUT" | "PATCH" = "POST",
): Promise<any> {
const isPut = method === "PUT";

View File

@ -8,7 +8,8 @@ export class Upload {
formData: Record<string, any>,
autoInform?: boolean,
getPercent?: Function,
method: "POST" | "PUT" | "PATCH" = "POST"
uploadId?: string, // 新增上传任务ID用于中断特定上传
method: "POST" | "PUT" | "PATCH" = "POST",
): Promise<any> {
const isPut = method === "PUT";

View File

@ -1,11 +1,14 @@
export class Upload {
async uploadFile(
file: string | File,
file: File | string,
name: string,
uploadUrl: string,
formData: Record<string, any>,
autoInform?: boolean
autoInform?: boolean,
getPercent?: Function,
uploadId?: string, // 新增上传任务ID用于中断特定上传
method: "POST" | "PUT" | "PATCH" = "POST",
): Promise<any> {
console.warn('server不会调用此函数')
}