😎1、修复文件上传 2、升级依赖
This commit is contained in:
parent
d0e4d47908
commit
22e82cad8c
@ -48,7 +48,7 @@ public class DeleteFileInput : BaseIdInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上传文件
|
/// 上传文件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UploadFileInput : SysFile
|
public class UploadFileInput
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件
|
/// 文件
|
||||||
@ -59,12 +59,12 @@ public class UploadFileInput : SysFile
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件类别
|
/// 文件类别
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override string FileType { get; set; }
|
public string FileType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否公开
|
/// 是否公开
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override bool IsPublic { get; set; } = false;
|
public bool IsPublic { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件路径
|
/// 文件路径
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
"echarts-wordcloud": "^2.1.0",
|
"echarts-wordcloud": "^2.1.0",
|
||||||
"element-plus": "^2.8.8",
|
"element-plus": "^2.8.8",
|
||||||
"exceljs": "^4.4.0",
|
"exceljs": "^4.4.0",
|
||||||
"ezuikit-js": "^8.1.1-alpha.3",
|
"ezuikit-js": "^8.1.1",
|
||||||
"gcoord": "^1.0.6",
|
"gcoord": "^1.0.6",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"js-table2excel": "^1.1.2",
|
"js-table2excel": "^1.1.2",
|
||||||
@ -71,7 +71,7 @@
|
|||||||
"vue-router": "^4.4.5",
|
"vue-router": "^4.4.5",
|
||||||
"vue-signature-pad": "^3.0.2",
|
"vue-signature-pad": "^3.0.2",
|
||||||
"vue3-tree-org": "^4.2.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": "^4.8.10",
|
||||||
"vxe-table-plugin-element": "^4.0.4",
|
"vxe-table-plugin-element": "^4.0.4",
|
||||||
"vxe-table-plugin-export-xlsx": "^4.0.7",
|
"vxe-table-plugin-export-xlsx": "^4.0.7",
|
||||||
|
|||||||
@ -579,10 +579,16 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 上传文件 🔖
|
* @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.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @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`;
|
const localVarPath = `/api/sysFile/uploadFile`;
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
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 localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
||||||
const localVarHeaderParameter = {} as any;
|
const localVarHeaderParameter = {} as any;
|
||||||
const localVarQueryParameter = {} as any;
|
const localVarQueryParameter = {} as any;
|
||||||
|
const localVarFormParams = new FormData();
|
||||||
|
|
||||||
// authentication Bearer required
|
// authentication Bearer required
|
||||||
// http bearer authentication required
|
// http bearer authentication required
|
||||||
@ -603,6 +610,32 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
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);
|
const query = new URLSearchParams(localVarUrlObj.search);
|
||||||
for (const key in localVarQueryParameter) {
|
for (const key in localVarQueryParameter) {
|
||||||
query.set(key, localVarQueryParameter[key]);
|
query.set(key, localVarQueryParameter[key]);
|
||||||
@ -613,6 +646,7 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
localVarRequestOptions.data = localVarFormParams;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||||
@ -892,11 +926,17 @@ export const SysFileApiFp = function(configuration?: Configuration) {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 上传文件 🔖
|
* @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.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysFileUploadFilePost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSysFile>>> {
|
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).apiSysFileUploadFilePost(options);
|
const localVarAxiosArgs = await SysFileApiAxiosParamCreator(configuration).apiSysFileUploadFilePostForm(file, fileType, isPublic, path, savePath, allowSuffix, options);
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
@ -1054,11 +1094,17 @@ export const SysFileApiFactory = function (configuration?: Configuration, basePa
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 上传文件 🔖
|
* @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.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysFileUploadFilePost(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSysFile>> {
|
async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSysFile>> {
|
||||||
return SysFileApiFp(configuration).apiSysFileUploadFilePost(options).then((request) => request(axios, basePath));
|
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 上传文件 🔖
|
* @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.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof SysFileApi
|
* @memberof SysFileApi
|
||||||
*/
|
*/
|
||||||
public async apiSysFileUploadFilePost(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSysFile>> {
|
public async apiSysFileUploadFilePostForm(file?: Blob, fileType?: string, isPublic?: boolean, path?: string, savePath?: string, allowSuffix?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSysFile>> {
|
||||||
return SysFileApiFp(this.configuration).apiSysFileUploadFilePost(options).then((request) => request(this.axios, this.basePath));
|
return SysFileApiFp(this.configuration).apiSysFileUploadFilePostForm(file, fileType, isPublic, path, savePath, allowSuffix, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -82,30 +82,6 @@ export interface PageCodeGenInput {
|
|||||||
*/
|
*/
|
||||||
descStr?: string | null;
|
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;
|
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;
|
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;
|
menuApplication?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否生成菜单
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof PageCodeGenInput
|
||||||
|
*/
|
||||||
|
generateMenu?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单父级
|
* 菜单父级
|
||||||
*
|
*
|
||||||
@ -241,4 +233,12 @@ export interface PageCodeGenInput {
|
|||||||
* @memberof PageCodeGenInput
|
* @memberof PageCodeGenInput
|
||||||
*/
|
*/
|
||||||
printName?: string | null;
|
printName?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否使用 Api Service
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof PageCodeGenInput
|
||||||
|
*/
|
||||||
|
isApiService?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -85,6 +85,14 @@ export interface SysOAuthUser {
|
|||||||
*/
|
*/
|
||||||
isDelete?: boolean;
|
isDelete?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邮箱
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof SysOAuthUser
|
||||||
|
*/
|
||||||
|
email?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统用户Id
|
* 系统用户Id
|
||||||
*
|
*
|
||||||
@ -147,14 +155,6 @@ export interface SysOAuthUser {
|
|||||||
*/
|
*/
|
||||||
avatar?: string | null;
|
avatar?: string | null;
|
||||||
|
|
||||||
/**
|
|
||||||
* 邮箱
|
|
||||||
*
|
|
||||||
* @type {string}
|
|
||||||
* @memberof SysOAuthUser
|
|
||||||
*/
|
|
||||||
email?: string | null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号码
|
* 手机号码
|
||||||
*
|
*
|
||||||
|
|||||||
@ -277,7 +277,7 @@ const handleChange = (file: any, fileList: []) => {
|
|||||||
// 上传
|
// 上传
|
||||||
const handleUpload = async () => {
|
const handleUpload = async () => {
|
||||||
if (state.fileList.length < 1) return;
|
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();
|
handleQuery();
|
||||||
ElMessage.success('上传成功');
|
ElMessage.success('上传成功');
|
||||||
state.visible = false;
|
state.visible = false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user