fix: 修复文件上传问题
This commit is contained in:
@@ -136,8 +136,6 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
{ DiscussId = output.Id, OldSeeNum = output.SeeNum });
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
|
||||
@@ -99,10 +99,14 @@ public class FileManager : DomainService, IFileManager
|
||||
this.LoggerFactory.CreateLogger<FileManager>().LogInformation(exception, exception.Message);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
this.LoggerFactory.CreateLogger<FileManager>().LogError(exception, exception.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
//如果失败了,直接复制一份到缩略图上即可
|
||||
compressImageStream = fileStream;
|
||||
this.LoggerFactory.CreateLogger<FileManager>().LogError(exception, exception.Message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -136,6 +136,14 @@ const router = createRouter({
|
||||
title: "数字藏品",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "book",
|
||||
path: "/book",
|
||||
component: () => import("../views/book/Index.vue"),
|
||||
meta: {
|
||||
title: "面试宝典",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
53
Yi.Bbs.Vue3/src/views/book/Index.vue
Normal file
53
Yi.Bbs.Vue3/src/views/book/Index.vue
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
<script setup>
|
||||
import BookCard from './components/BookCard.vue'
|
||||
import {getList} from '@/apis/discussApi'
|
||||
import { ref, onMounted } from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
const discussList=ref([]);
|
||||
|
||||
//面试宝典板块id
|
||||
const bookPlateId="d940818d-90ec-9dbe-b7af-3a0f935dac0a";
|
||||
onMounted(async ()=>{
|
||||
const {data}=await getList({plateId:bookPlateId, skipCount:1,maxResultCount:100});
|
||||
discussList.value=data.items;
|
||||
})
|
||||
const router = useRouter();
|
||||
const enterDiscuss = (id) => {
|
||||
router.push(`/article/${id}`);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="body">
|
||||
<p class="title">面试宝典</p>
|
||||
<div class="content">
|
||||
<el-row :gutter="20">
|
||||
<el-col @click="enterDiscuss(discussInfo.id)" v-for="discussInfo in discussList" :xs="12" :sm="8" :md="8" :lg="6" :xl="6">
|
||||
<BookCard :discuss="discussInfo"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<style scoped>
|
||||
.el-col{
|
||||
cursor: pointer; /* 显示手型光标 */
|
||||
margin: 10px 0;
|
||||
}
|
||||
.body{
|
||||
width: 1200px;
|
||||
.title{
|
||||
margin-top: 0.5em;
|
||||
font-size: 24px;
|
||||
line-height: 1.2667;
|
||||
color: rgba(0, 0, 0, 0.88);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
71
Yi.Bbs.Vue3/src/views/book/components/BookCard.vue
Normal file
71
Yi.Bbs.Vue3/src/views/book/components/BookCard.vue
Normal file
@@ -0,0 +1,71 @@
|
||||
<script setup>
|
||||
|
||||
import { ref, onMounted } from "vue";
|
||||
|
||||
const props = defineProps([
|
||||
"discuss",
|
||||
]);
|
||||
const discuss=ref(props.discuss)
|
||||
onMounted(()=>{
|
||||
|
||||
})
|
||||
const getUrl = (str) => {
|
||||
return `${import.meta.env.VITE_APP_BASEAPI}/file/${str}`;
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<div class="card-body">
|
||||
<div class="left-logo">
|
||||
<el-image style="width: 40px; height: 40px"
|
||||
:src="getUrl(discuss.cover)"
|
||||
fit="fill">
|
||||
<template #error>
|
||||
<el-icon size="40px" color="#F0F2F5"><Picture /></el-icon>
|
||||
</template>
|
||||
</el-image>
|
||||
|
||||
</div>
|
||||
<div class="right-content">
|
||||
|
||||
<div class="content-top">
|
||||
{{discuss.title}}
|
||||
</div>
|
||||
<div class="content-bottom">
|
||||
{{discuss.introduction}}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.card-body {
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
padding: 24px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
.left-logo{
|
||||
|
||||
}
|
||||
.right-content{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 15px;
|
||||
overflow: hidden;
|
||||
.content-top{
|
||||
color: rgba(0, 0, 0, 0.88);
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.content-bottom{
|
||||
font-size: 14px;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user