feat: 完善app首页应用
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import myaxios from '@/utils/myaxios'
|
||||
|
||||
export default{
|
||||
upload(type:string,data:any){
|
||||
upload(data:any){
|
||||
return myaxios({
|
||||
url: `/file/upload/${type}`,
|
||||
url: `/file`,
|
||||
headers:{"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"},
|
||||
method: 'POST',
|
||||
method: 'post',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ const afterRead = (file: any) => {
|
||||
});
|
||||
}
|
||||
|
||||
fileApi.upload("image", formData).then((response: any) => {
|
||||
images.value.push(...response.data);
|
||||
fileApi.upload(formData).then((response: any) => {
|
||||
images.value.push(...response.data.map((x:any)=>x.id));
|
||||
|
||||
if (file.length == undefined) {
|
||||
file.status = "done";
|
||||
|
||||
@@ -27,8 +27,23 @@ namespace Yi.Furion.Application.App.Services.Impl
|
||||
|
||||
var entities = await _DbQueryable
|
||||
.WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)
|
||||
.OrderByDescending(x=>x.CreationTime)
|
||||
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||
return new PagedResultDto<TrendsGetListOutputDto>(total, await MapToGetListOutputDtosAsync(entities));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发布文章
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public override Task<TrendsGetOutputDto> CreateAsync(TrendsCreateInput input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input.Title))
|
||||
{
|
||||
input.Title = input.Content.Substring(0, Math.Min(5, input.Content.Length));
|
||||
}
|
||||
return base.CreateAsync(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,13 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.Furion.Application.App.Services.Impl.TrendsService.CreateAsync(Yi.Furion.Core.App.Dtos.Trends.TrendsCreateInput)">
|
||||
<summary>
|
||||
发布文章
|
||||
</summary>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Yi.Furion.Application.App.Services.ITrendsService">
|
||||
<summary>
|
||||
Trends服务抽象
|
||||
|
||||
Reference in New Issue
Block a user