feat: 开发中...

This commit is contained in:
2023-04-06 09:18:12 +08:00
parent b5eb9b468e
commit f8d2c94586
8 changed files with 81 additions and 37 deletions

View File

@@ -24,8 +24,8 @@ public class AttachEntity {
private Long id;
@Setter
@Column(name = "name", nullable = false)
private String name;
@Column(name = "filename", nullable = false)
private String filename;
@Setter
@Column(name = "content_type", nullable = false)

View File

@@ -50,7 +50,7 @@ public class AttachService implements IAttachService {
}
log.info("prepare to save file: {}({} bytes)", file.getOriginalFilename(), file.getSize());
AttachEntity attachEntity = new AttachEntity();
attachEntity.setName(file.getOriginalFilename());
attachEntity.setFilename(file.getOriginalFilename());
attachEntity.setContentType(file.getContentType());
attachEntity.setData(file.getBytes());
attachEntity = attachRepo.save(attachEntity);
@@ -91,7 +91,7 @@ public class AttachService implements IAttachService {
return ResponseEntity
.ok()
.header("Cache-Control", "no-cache, no-store, must-revalidate")
.header("Content-Disposition", String.format("attachment; filename=\"%s\"", entity.getName()))
.header("Content-Disposition", String.format("attachment; filename=\"%s\"", entity.getFilename()))
.header("Pragma", "no-cache")
.header("Expires", "0")
.contentLength(localCacheFile.length())

View File

@@ -15,6 +15,10 @@ public class AttachInfoResponseVO {
@NotNull
private Long id;
@NotNull
private String filename;
@NotNull
private String contentType;
@NotNull
private UserInfoResponseVO creator;
@NotNull
private UserInfoResponseVO updater;

View File

@@ -0,0 +1,20 @@
<script setup lang="ts">
</script>
<template>
<div class="attach-contailer">
<div style="display: flex">
<div style="flex-grow: 1"></div>
<el-button type="primary">上传新附件</el-button>
<div style="flex-grow: 1"></div>
</div>
</div>
</template>
<style scoped>
.attach-contailer {
height: 100%;
width: 100%;
}
</style>

View File

@@ -7,13 +7,13 @@ import { api } from "@/api";
import router from "@/router";
import { ElMessage } from "element-plus";
let pageIndex = ref(0);
let pageIndex = ref(1);
let pageSize = 2;
let pageCount = 100;
const blogs = ref<Array<BlogInfoResponseVO>>();
onMounted(() => {
changePage(1);
loadPage(1);
});
function editBlog(blogID: number) {
@@ -28,6 +28,7 @@ function deleteBlog(blogID: number) {
type: "success",
message: "删除博客成功!",
});
loadPage(pageIndex.value);
} else {
ElMessage({
type: "error",
@@ -53,7 +54,7 @@ function showUpdater() {
console.log("showUpdater");
}
function changePage(newPage: number) {
function loadPage(newPage: number) {
api.BlogController.getBlogInfoList(newPage - 1, pageSize).then((resp) => {
const vo = resp.data;
const page = vo.content;
@@ -140,7 +141,7 @@ function changePage(newPage: number) {
:hide-on-single-page="false"
:current-page="pageIndex"
:page-count="pageCount"
@update:current-page="changePage"
@update:current-page="loadPage"
/>
<div style="flex-grow: 1"></div>
</div>

View File

@@ -34,6 +34,7 @@ function changeCustomCSS(cssText: string) {
</script>
<template>
<el-form class="manage-container">
<el-input
class="imput-line"
v-model="siteSetting.title"
@@ -47,6 +48,7 @@ function changeCustomCSS(cssText: string) {
type="textarea"
show-word-limit
maxlength="1024"
autosize
v-model="siteSetting.footer"
placeholder="页脚文本支持HTML"
@change="changeFooterHTML(siteSetting.footer)"
@@ -59,9 +61,13 @@ function changeCustomCSS(cssText: string) {
placeholder="自定义CSS"
@change="changeCustomCSS(siteSetting.css)"
/>
</el-form>
</template>
<style scoped>
.manage-container {
margin-right: 32px;
}
.imput-line {
margin-bottom: 5px;
}

View File

@@ -0,0 +1,7 @@
<script setup lang="ts"></script>
<template>
<div></div>
</template>
<style scoped></style>

View File

@@ -2,8 +2,10 @@
import { onMounted, ref } from "vue";
import { globalStore } from "@/api";
import SiteManageComponent from "@/components/manage/SiteManageComponent.vue";
import AttachManageComponent from "@/components/manage/AttachManageComponent.vue";
import BlogManageComponent from "@/components/manage/BlogManageComponent.vue";
import SiteManageComponent from "@/components/manage/SiteManageComponent.vue";
import UserManageComponent from "@/components/manage/UserManageComponent.vue";
const activeName = ref<string>("site");
@@ -25,11 +27,15 @@ onMounted(() => {
<el-tab-pane label="网站设置" name="site">
<SiteManageComponent />
</el-tab-pane>
<el-tab-pane label="博文设置" name="third">
<el-tab-pane label="博文管理" name="third">
<BlogManageComponent />
</el-tab-pane>
<el-tab-pane label="用户设置" name="user">Config</el-tab-pane>
<el-tab-pane label="评论设置" name="test">Role</el-tab-pane>
<el-tab-pane label="附件管理" name="user">
<AttachManageComponent />
</el-tab-pane>
<el-tab-pane label="用户管理" name="test">
<UserManageComponent />
</el-tab-pane>
</el-tabs>
</template>