Merge branch 'dev' of gitea.51mars.com:Oak-Team/oak-frontend-base into dev
This commit is contained in:
commit
b8e3dcd24a
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 预签名上传
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 预签名上传
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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不会调用此函数')
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue