feat: 开发中...
This commit is contained in:
@@ -50,7 +50,7 @@ public class BlogController {
|
||||
|
||||
@DeleteMapping("/{blogID}/")
|
||||
@Operation(summary = "删除博文")
|
||||
public ResponseVO<Void> removeBlog(@PathVariable Long blogID) {
|
||||
return blogService.removeBlog(blogID);
|
||||
public ResponseVO<Void> deleteBlog(@PathVariable Long blogID) {
|
||||
return blogService.deleteBlog(blogID);
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ public class AttachEntity {
|
||||
|
||||
@CreatedDate
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "create_time", nullable = false)
|
||||
@Column(name = "create_time", nullable = false, updatable = false)
|
||||
private Date createTime;
|
||||
|
||||
@LastModifiedDate
|
||||
|
@@ -54,7 +54,7 @@ public class BlogAttachEntity {
|
||||
|
||||
@CreatedDate
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "create_time", nullable = false)
|
||||
@Column(name = "create_time", nullable = false, updatable = false)
|
||||
private Date createTime;
|
||||
|
||||
@LastModifiedDate
|
||||
|
@@ -74,7 +74,7 @@ public class BlogEntity {
|
||||
|
||||
@CreatedDate
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "create_time", nullable = false)
|
||||
@Column(name = "create_time", nullable = false, updatable = false)
|
||||
private Date createTime;
|
||||
|
||||
@LastModifiedDate
|
||||
|
@@ -33,7 +33,7 @@ public class SettingEntity {
|
||||
|
||||
@CreatedDate
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "create_time", nullable = false)
|
||||
@Column(name = "create_time", nullable = false, updatable = false)
|
||||
private Date createTime;
|
||||
|
||||
@LastModifiedDate
|
||||
|
@@ -63,7 +63,7 @@ public class UserEntity {
|
||||
|
||||
@CreatedDate
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "create_time", nullable = false)
|
||||
@Column(name = "create_time", nullable = false, updatable = false)
|
||||
private Date createTime;
|
||||
|
||||
@LastModifiedDate
|
||||
|
@@ -16,5 +16,5 @@ public interface IBlogService {
|
||||
|
||||
@NotNull ResponseVO<Void> updateBlog(@NotNull Long blogID, @NotNull BlogUpdateRequireVO requireVO);
|
||||
|
||||
@NotNull ResponseVO<Void> removeBlog(@NotNull Long blogID);
|
||||
@NotNull ResponseVO<Void> deleteBlog(@NotNull Long blogID);
|
||||
}
|
||||
|
@@ -30,7 +30,6 @@ public class BlogService implements IBlogService {
|
||||
if (checked != null) {
|
||||
return checked;
|
||||
}
|
||||
log.info("create blog vo: {}", requireVO);
|
||||
BlogEntity entity = blogMapper.voToEntity(requireVO);
|
||||
entity = blogRepo.save(entity);
|
||||
return ResponseVO.success(entity.getId());
|
||||
@@ -54,7 +53,7 @@ public class BlogService implements IBlogService {
|
||||
if (user == null) {
|
||||
return ResponseVO.unauthorized();
|
||||
}
|
||||
log.info("update blog vo: {}", requireVO);
|
||||
log.info("update blog vo: {}", blogID);
|
||||
BlogEntity blogEntity = blogRepo.findByIdWithCreator(blogID);
|
||||
if (blogEntity == null) {
|
||||
return ResponseVO.failed("该博文不存在!");
|
||||
@@ -78,11 +77,12 @@ public class BlogService implements IBlogService {
|
||||
blogEntity.setPublish(requireVO.getPublish());
|
||||
blogEntity.setTags(requireVO.getTags());
|
||||
blogRepo.save(blogEntity);
|
||||
|
||||
return ResponseVO.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ResponseVO<Void> removeBlog(@NotNull Long blogID) {
|
||||
public @NotNull ResponseVO<Void> deleteBlog(@NotNull Long blogID) {
|
||||
BlogUser user = BlogUtils.getCurrentUser().orElse(null);
|
||||
if (user == null) {
|
||||
return ResponseVO.unauthorized();
|
||||
|
@@ -40,7 +40,7 @@ function showUpdater() {
|
||||
{{ blog.creator.nickname }}
|
||||
</p>
|
||||
<p>
|
||||
{{ " 首次发表于:" + blog.updateTime.toLocaleString() }}
|
||||
{{ " 首次发表于:" + blog.createTime.toLocaleString() }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,12 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
|
||||
const form = ref({
|
||||
file: undefined,
|
||||
});
|
||||
const uploadDialog = ref<boolean>(false);
|
||||
|
||||
function upload() {}
|
||||
|
||||
function handleClose() {}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="uploadDialog"
|
||||
title="Tips"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<el-form :model="form">
|
||||
<el-form-item label="Promotion name" label-width="120px">
|
||||
<el-input v-model="form.file" type="file" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="uploadDialog = false"> 取消 </el-button>
|
||||
<el-button type="primary" @click="uploadDialog = false">
|
||||
确认
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<div class="attach-contailer">
|
||||
<div style="display: flex">
|
||||
<div style="flex-grow: 1"></div>
|
||||
<el-button type="primary">上传新附件</el-button>
|
||||
<el-button type="primary" @click="uploadDialog = true">
|
||||
上传新附件
|
||||
</el-button>
|
||||
<div style="flex-grow: 1"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -102,7 +102,7 @@ function loadPage(newPage: number) {
|
||||
{{ blog.creator.nickname }}
|
||||
</p>
|
||||
<p>
|
||||
{{ " 首次发表于:" + blog.updateTime.toLocaleString() }}
|
||||
{{ " 首次发表于:" + blog.createTime.toLocaleString() }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -34,7 +34,8 @@ function changeCustomCSS(cssText: string) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-form class="manage-container">
|
||||
<el-form class="manage-container" label-width="120px">
|
||||
<el-form-item label="网站标题">
|
||||
<el-input
|
||||
class="imput-line"
|
||||
v-model="siteSetting.title"
|
||||
@@ -43,6 +44,8 @@ function changeCustomCSS(cssText: string) {
|
||||
show-word-limit
|
||||
maxlength="10"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="页脚文本">
|
||||
<el-input
|
||||
class="imput-line"
|
||||
type="textarea"
|
||||
@@ -53,6 +56,8 @@ function changeCustomCSS(cssText: string) {
|
||||
placeholder="页脚文本(支持HTML)"
|
||||
@change="changeFooterHTML(siteSetting.footer)"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="自定义CSS">
|
||||
<el-input
|
||||
class="imput-line"
|
||||
type="textarea"
|
||||
@@ -61,6 +66,7 @@ function changeCustomCSS(cssText: string) {
|
||||
placeholder="自定义CSS"
|
||||
@change="changeCustomCSS(siteSetting.css)"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
|
@@ -143,7 +143,7 @@ function handleCreated(editor: IDomEditor) {
|
||||
<el-form-item label="博文摘要">
|
||||
<el-input
|
||||
placeholder="博文摘要"
|
||||
maxlength="512"
|
||||
maxlength="1024"
|
||||
show-word-limit
|
||||
type="textarea"
|
||||
autosize
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import "@wangeditor/editor/dist/css/style.css";
|
||||
import { ref } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
@@ -108,28 +107,58 @@ function deleteBlog() {
|
||||
.blog-content {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.blog-content > h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5 {
|
||||
line-height: 64px;
|
||||
}
|
||||
|
||||
.blog-content > p {
|
||||
line-height: 24px;
|
||||
.blog-content > p,
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.blog-content > * {
|
||||
font-family: system-ui;
|
||||
font-size: normal;
|
||||
.blog-content p,
|
||||
.blog-content li {
|
||||
white-space: pre-wrap; /* 保留空格 */
|
||||
}
|
||||
|
||||
.blog-content > pre {
|
||||
margin: 12px 0 12px 0;
|
||||
padding: 12px 12px 12px 12px;
|
||||
background-color: #ccc;
|
||||
.blog-content blockquote {
|
||||
border-left: 8px solid #d0e5f2;
|
||||
padding: 10px 10px;
|
||||
margin: 10px 0;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.blog-content code {
|
||||
font-family: monospace;
|
||||
background-color: #eee;
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.blog-content pre > code {
|
||||
display: block;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.blog-content table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.blog-content td,
|
||||
.blog-content th {
|
||||
border: 1px solid #ccc;
|
||||
min-width: 50px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.blog-content th {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.blog-content ul,
|
||||
.blog-content ol {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.blog-content input[type="checkbox"] {
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
|
@@ -23,20 +23,30 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-tabs v-model="activeName" type="card" class="demo-tabs">
|
||||
<el-tab-pane label="网站设置" name="site">
|
||||
<el-tabs v-model="activeName" type="card" class="manage-tabs">
|
||||
<el-tab-pane label="网站设置" name="site" class="manage-sub-tab">
|
||||
<SiteManageComponent />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="博文管理" name="third">
|
||||
<el-tab-pane label="博文管理" name="third" class="manage-sub-tab">
|
||||
<BlogManageComponent />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="附件管理" name="user">
|
||||
<el-tab-pane label="附件管理" name="user" class="manage-sub-tab">
|
||||
<AttachManageComponent />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="用户管理" name="test">
|
||||
<el-tab-pane label="用户管理" name="test" class="manage-sub-tab">
|
||||
<UserManageComponent />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
.manage-tabs {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 5px 30px 0 30px;
|
||||
}
|
||||
.manage-sub-tab {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user