😎1、修复文件上传 2、升级依赖

This commit is contained in:
zuohuaijun 2024-11-18 22:26:08 +08:00
parent d0e4d47908
commit 22e82cad8c
7 changed files with 122 additions and 2219 deletions

View File

@ -48,7 +48,7 @@ public class DeleteFileInput : BaseIdInput
/// <summary>
/// 上传文件
/// </summary>
public class UploadFileInput : SysFile
public class UploadFileInput
{
/// <summary>
/// 文件
@ -59,12 +59,12 @@ public class UploadFileInput : SysFile
/// <summary>
/// 文件类别
/// </summary>
public override string FileType { get; set; }
public string FileType { get; set; }
/// <summary>
/// 是否公开
/// </summary>
public override bool IsPublic { get; set; } = false;
public bool IsPublic { get; set; } = false;
/// <summary>
/// 文件路径

View File

@ -35,7 +35,7 @@
"echarts-wordcloud": "^2.1.0",
"element-plus": "^2.8.8",
"exceljs": "^4.4.0",
"ezuikit-js": "^8.1.1-alpha.3",
"ezuikit-js": "^8.1.1",
"gcoord": "^1.0.6",
"js-cookie": "^3.0.5",
"js-table2excel": "^1.1.2",
@ -71,7 +71,7 @@
"vue-router": "^4.4.5",
"vue-signature-pad": "^3.0.2",
"vue3-tree-org": "^4.2.2",
"vxe-pc-ui": "^4.3.0",
"vxe-pc-ui": "^4.3.1",
"vxe-table": "^4.8.10",
"vxe-table-plugin-element": "^4.0.4",
"vxe-table-plugin-export-xlsx": "^4.0.7",

View File

@ -579,10 +579,16 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
/**
*
* @summary 🔖
* @param {Blob} [file]
* @param {string} [fileType]
* @param {boolean} [isPublic]
* @param {string} [path]
* @param {string} [savePath]
* @param {string} [allowSuffix]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiSysFileUploadFilePost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
apiSysFileUploadFilePostForm: async (file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/sysFile/uploadFile`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
@ -593,6 +599,7 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
const localVarFormParams = new FormData();
// authentication Bearer required
// http bearer authentication required
@ -603,6 +610,32 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
if (file !== undefined) {
localVarFormParams.append('File', file as any);
}
if (fileType !== undefined) {
localVarFormParams.append('FileType', fileType as any);
}
if (isPublic !== undefined) {
localVarFormParams.append('IsPublic', isPublic as any);
}
if (path !== undefined) {
localVarFormParams.append('Path', path as any);
}
if (savePath !== undefined) {
localVarFormParams.append('SavePath', savePath as any);
}
if (allowSuffix !== undefined) {
localVarFormParams.append('AllowSuffix', allowSuffix as any);
}
localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
@ -613,6 +646,7 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = localVarFormParams;
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
@ -892,11 +926,17 @@ export const SysFileApiFp = function(configuration?: Configuration) {
/**
*
* @summary 🔖
* @param {Blob} [file]
* @param {string} [fileType]
* @param {boolean} [isPublic]
* @param {string} [path]
* @param {string} [savePath]
* @param {string} [allowSuffix]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysFileUploadFilePost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSysFile>>> {
const localVarAxiosArgs = await SysFileApiAxiosParamCreator(configuration).apiSysFileUploadFilePost(options);
async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSysFile>>> {
const localVarAxiosArgs = await SysFileApiAxiosParamCreator(configuration).apiSysFileUploadFilePostForm(file, fileType, isPublic, path, savePath, allowSuffix, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
@ -1054,11 +1094,17 @@ export const SysFileApiFactory = function (configuration?: Configuration, basePa
/**
*
* @summary 🔖
* @param {Blob} [file]
* @param {string} [fileType]
* @param {boolean} [isPublic]
* @param {string} [path]
* @param {string} [savePath]
* @param {string} [allowSuffix]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiSysFileUploadFilePost(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSysFile>> {
return SysFileApiFp(configuration).apiSysFileUploadFilePost(options).then((request) => request(axios, basePath));
async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSysFile>> {
return SysFileApiFp(configuration).apiSysFileUploadFilePostForm(file, fileType, isPublic, path, savePath, allowSuffix, options).then((request) => request(axios, basePath));
},
/**
*
@ -1216,12 +1262,18 @@ export class SysFileApi extends BaseAPI {
/**
*
* @summary 🔖
* @param {Blob} [file]
* @param {string} [fileType]
* @param {boolean} [isPublic]
* @param {string} [path]
* @param {string} [savePath]
* @param {string} [allowSuffix]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SysFileApi
*/
public async apiSysFileUploadFilePost(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSysFile>> {
return SysFileApiFp(this.configuration).apiSysFileUploadFilePost(options).then((request) => request(this.axios, this.basePath));
public async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSysFile>> {
return SysFileApiFp(this.configuration).apiSysFileUploadFilePostForm(file, fileType, isPublic, path, savePath, allowSuffix, options).then((request) => request(this.axios, this.basePath));
}
/**
*

View File

@ -82,30 +82,6 @@ export interface PageCodeGenInput {
*/
descStr?: string | null;
/**
*
*
* @type {string}
* @memberof PageCodeGenInput
*/
tableName?: string | null;
/**
*
*
* @type {string}
* @memberof PageCodeGenInput
*/
busName?: string | null;
/**
*
*
* @type {string}
* @memberof PageCodeGenInput
*/
nameSpace?: string | null;
/**
*
*
@ -114,30 +90,6 @@ export interface PageCodeGenInput {
*/
authorName?: string | null;
/**
*
*
* @type {string}
* @memberof PageCodeGenInput
*/
generateType?: string | null;
/**
*
*
* @type {boolean}
* @memberof PageCodeGenInput
*/
generateMenu?: boolean;
/**
* 使 Api Service
*
* @type {boolean}
* @memberof PageCodeGenInput
*/
isApiService?: boolean;
/**
*
*
@ -186,6 +138,38 @@ export interface PageCodeGenInput {
*/
connectionString?: string | null;
/**
*
*
* @type {string}
* @memberof PageCodeGenInput
*/
generateType?: string | null;
/**
*
*
* @type {string}
* @memberof PageCodeGenInput
*/
tableName?: string | null;
/**
*
*
* @type {string}
* @memberof PageCodeGenInput
*/
nameSpace?: string | null;
/**
*
*
* @type {string}
* @memberof PageCodeGenInput
*/
busName?: string | null;
/**
*
*
@ -202,6 +186,14 @@ export interface PageCodeGenInput {
*/
menuApplication?: string | null;
/**
*
*
* @type {boolean}
* @memberof PageCodeGenInput
*/
generateMenu?: boolean;
/**
*
*
@ -241,4 +233,12 @@ export interface PageCodeGenInput {
* @memberof PageCodeGenInput
*/
printName?: string | null;
/**
* 使 Api Service
*
* @type {boolean}
* @memberof PageCodeGenInput
*/
isApiService?: boolean;
}

File diff suppressed because it is too large Load Diff

View File

@ -85,6 +85,14 @@ export interface SysOAuthUser {
*/
isDelete?: boolean;
/**
*
*
* @type {string}
* @memberof SysOAuthUser
*/
email?: string | null;
/**
* Id
*
@ -147,14 +155,6 @@ export interface SysOAuthUser {
*/
avatar?: string | null;
/**
*
*
* @type {string}
* @memberof SysOAuthUser
*/
email?: string | null;
/**
*
*

View File

@ -277,7 +277,7 @@ const handleChange = (file: any, fileList: []) => {
//
const handleUpload = async () => {
if (state.fileList.length < 1) return;
await getAPI(SysFileApi).apiSysFileUploadFilesPostForm([state.fileList[0].raw]);
await getAPI(SysFileApi).apiSysFileUploadFilePostForm(state.fileList[0].raw, state.fileType, state.isPublic);
handleQuery();
ElMessage.success('上传成功');
state.visible = false;