feat: 编辑器与帖子展示布局优化 + 新增个人空间

- 编辑器投稿页布局优化:标题与编辑器高度动态适配,工具栏与内容区视觉对齐
- 稿件展示页布局优化:MD 渲染区与评论区视觉分离,代码块主题微调
- CSRF 中间件:图像上传端点豁免,解决 Vditor 拖拽/粘贴上传 403
- Post 状态映射、GetGinUser、SaveUploadedFile 提取至 common 包,遵循审计建议
- 新增个人空间功能:/space(需登录)重定向到 /space/:uid,/space/:uid 公开访问
- 空间页模板:参考 B 站布局,展示头像、用户名、个性签名、UID、加入时间及稿件列表
- 导航栏:用户名链接指向 /space,新增「设置」入口
- 分层实现:SpaceController → SpaceService → PostRepo.FindByUserID,严格 ISP 接口隔离
This commit is contained in:
2026-05-30 19:06:10 +08:00
parent 40f0529cbf
commit bacfd4945d
31 changed files with 1229 additions and 252 deletions

View File

@ -297,7 +297,11 @@
height: calc(100vh - 56px);
display: flex;
flex-direction: column;
overflow: hidden;
overflow: visible;
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 0 28px;
}
.editor-form {
@ -307,7 +311,7 @@
}
.editor-header {
padding: 16px 24px 12px;
padding: 16px 0 12px;
border-bottom: 1px solid #e5e7eb;
background: #fff;
flex-shrink: 0;
@ -330,21 +334,73 @@
.editor-main {
flex: 1;
display: flex;
overflow: hidden;
overflow: visible;
min-height: 0;
}
.editor-pane {
flex: 1;
overflow: hidden;
overflow: visible;
min-width: 0;
}
.editor-sidebar {
width: 250px;
flex-shrink: 0;
margin-left: 24px;
display: flex;
flex-direction: column;
gap: 16px;
overflow-y: auto;
font-size: 13px;
color: #4b5563;
}
.editor-sidebar-section {
background: #fff;
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 14px 16px;
}
.editor-sidebar-section h4 {
font-size: 12px;
font-weight: 600;
color: #9ca3af;
text-transform: uppercase;
letter-spacing: 0.05em;
margin: 0 0 10px 0;
}
.editor-sidebar-section .tips-list {
list-style: none;
padding: 0;
margin: 0;
}
.editor-sidebar-section .tips-list li {
padding: 5px 0;
border-bottom: 1px solid #f3f4f6;
line-height: 1.5;
}
.editor-sidebar-section .tips-list li:last-child {
border-bottom: none;
}
.editor-sidebar-section .tips-list code {
background: #f3f4f6;
padding: 1px 5px;
border-radius: 3px;
font-size: 12px;
color: #6366f1;
}
.editor-statusbar {
display: flex;
align-items: center;
gap: 16px;
padding: 6px 20px;
padding: 6px 0;
background: #fafafa;
border-top: 1px solid #e5e7eb;
font-size: 12px;
@ -364,32 +420,19 @@
z-index: 9999;
height: 100vh;
background: #fff;
max-width: none;
}
/* ========== Vditor 编辑器容器 ========== */
/* Vditor 自动生成工具栏、编辑区、状态栏,仅做外层布局微调 */
/* 仅提供高度约束,不干预 Vditor 内部布局和弹窗 */
#vditor {
flex: 1;
overflow: hidden;
min-height: 0;
display: flex;
flex-direction: column;
}
/* Vditor 工具栏微调 — 匹配项目主题色 */
.vditor-toolbar {
background: #fafafa !important;
border-bottom: 1px solid #e5e7eb !important;
}
/* Vditor 内容区适配 */
.vditor-content {
font-size: 15px;
line-height: 1.7;
color: #24292f;
}
/* Vditor 预览/渲染区域 — 详情页 */
.post-detail-body .vditor-reset {
font-size: 16px;