Merge branch 'v2' of https://code.adminnet.top/Admin.NET/Admin.NET.Pro into v2
This commit is contained in:
commit
8f9c1caa5d
@ -333,7 +333,7 @@ if(@column.EffectType == "Upload"){
|
|||||||
@:public async Task<SysFile> Upload@(@column.PropertyName)([Required] IFormFile file)
|
@:public async Task<SysFile> Upload@(@column.PropertyName)([Required] IFormFile file)
|
||||||
@:{
|
@:{
|
||||||
@:var service = App.GetRequiredService<SysFileService>();
|
@:var service = App.GetRequiredService<SysFileService>();
|
||||||
@:return await service.UploadFile(new UploadFileInput { File = file, Path = "upload/@(@column.PropertyName)" });
|
@:return await service.UploadFile(new UploadFileInput { File = file}, "upload/@(@column.PropertyName)" );
|
||||||
@:}
|
@:}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -435,9 +435,9 @@ if(@column.EffectType == "Upload"){
|
|||||||
@:// 上传@(@column.ColumnComment)
|
@:// 上传@(@column.ColumnComment)
|
||||||
@:const upload@(@column.PropertyName)Handle = async (options: UploadRequestOptions) => {
|
@:const upload@(@column.PropertyName)Handle = async (options: UploadRequestOptions) => {
|
||||||
@if (@Model.IsApiService) {
|
@if (@Model.IsApiService) {
|
||||||
@:let res = await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)Upload@(@column.FkEntityName)PostForm(options);
|
@:let res = await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)Upload@(@column.PropertyName)PostForm(options.file);
|
||||||
} else {
|
} else {
|
||||||
@:let res = await upload@(@column.PropertyName)(options);
|
@:let res = await upload@(@column.PropertyName)(options.file);
|
||||||
}
|
}
|
||||||
@:state.ruleForm.@(column.LowerPropertyName) = res.data.result?.url;
|
@:state.ruleForm.@(column.LowerPropertyName) = res.data.result?.url;
|
||||||
@:};
|
@:};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user