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