feat: 开发中...
This commit is contained in:
@@ -24,8 +24,8 @@ public class AttachEntity {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@Column(name = "name", nullable = false)
|
@Column(name = "filename", nullable = false)
|
||||||
private String name;
|
private String filename;
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@Column(name = "content_type", nullable = false)
|
@Column(name = "content_type", nullable = false)
|
||||||
|
@@ -50,7 +50,7 @@ public class AttachService implements IAttachService {
|
|||||||
}
|
}
|
||||||
log.info("prepare to save file: {}({} bytes)", file.getOriginalFilename(), file.getSize());
|
log.info("prepare to save file: {}({} bytes)", file.getOriginalFilename(), file.getSize());
|
||||||
AttachEntity attachEntity = new AttachEntity();
|
AttachEntity attachEntity = new AttachEntity();
|
||||||
attachEntity.setName(file.getOriginalFilename());
|
attachEntity.setFilename(file.getOriginalFilename());
|
||||||
attachEntity.setContentType(file.getContentType());
|
attachEntity.setContentType(file.getContentType());
|
||||||
attachEntity.setData(file.getBytes());
|
attachEntity.setData(file.getBytes());
|
||||||
attachEntity = attachRepo.save(attachEntity);
|
attachEntity = attachRepo.save(attachEntity);
|
||||||
@@ -91,7 +91,7 @@ public class AttachService implements IAttachService {
|
|||||||
return ResponseEntity
|
return ResponseEntity
|
||||||
.ok()
|
.ok()
|
||||||
.header("Cache-Control", "no-cache, no-store, must-revalidate")
|
.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("Pragma", "no-cache")
|
||||||
.header("Expires", "0")
|
.header("Expires", "0")
|
||||||
.contentLength(localCacheFile.length())
|
.contentLength(localCacheFile.length())
|
||||||
|
@@ -15,6 +15,10 @@ public class AttachInfoResponseVO {
|
|||||||
@NotNull
|
@NotNull
|
||||||
private Long id;
|
private Long id;
|
||||||
@NotNull
|
@NotNull
|
||||||
|
private String filename;
|
||||||
|
@NotNull
|
||||||
|
private String contentType;
|
||||||
|
@NotNull
|
||||||
private UserInfoResponseVO creator;
|
private UserInfoResponseVO creator;
|
||||||
@NotNull
|
@NotNull
|
||||||
private UserInfoResponseVO updater;
|
private UserInfoResponseVO updater;
|
||||||
|
@@ -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>
|
@@ -7,13 +7,13 @@ import { api } from "@/api";
|
|||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
let pageIndex = ref(0);
|
let pageIndex = ref(1);
|
||||||
let pageSize = 2;
|
let pageSize = 2;
|
||||||
let pageCount = 100;
|
let pageCount = 100;
|
||||||
const blogs = ref<Array<BlogInfoResponseVO>>();
|
const blogs = ref<Array<BlogInfoResponseVO>>();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
changePage(1);
|
loadPage(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
function editBlog(blogID: number) {
|
function editBlog(blogID: number) {
|
||||||
@@ -28,6 +28,7 @@ function deleteBlog(blogID: number) {
|
|||||||
type: "success",
|
type: "success",
|
||||||
message: "删除博客成功!",
|
message: "删除博客成功!",
|
||||||
});
|
});
|
||||||
|
loadPage(pageIndex.value);
|
||||||
} else {
|
} else {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: "error",
|
type: "error",
|
||||||
@@ -53,7 +54,7 @@ function showUpdater() {
|
|||||||
console.log("showUpdater");
|
console.log("showUpdater");
|
||||||
}
|
}
|
||||||
|
|
||||||
function changePage(newPage: number) {
|
function loadPage(newPage: number) {
|
||||||
api.BlogController.getBlogInfoList(newPage - 1, pageSize).then((resp) => {
|
api.BlogController.getBlogInfoList(newPage - 1, pageSize).then((resp) => {
|
||||||
const vo = resp.data;
|
const vo = resp.data;
|
||||||
const page = vo.content;
|
const page = vo.content;
|
||||||
@@ -140,7 +141,7 @@ function changePage(newPage: number) {
|
|||||||
:hide-on-single-page="false"
|
:hide-on-single-page="false"
|
||||||
:current-page="pageIndex"
|
:current-page="pageIndex"
|
||||||
:page-count="pageCount"
|
:page-count="pageCount"
|
||||||
@update:current-page="changePage"
|
@update:current-page="loadPage"
|
||||||
/>
|
/>
|
||||||
<div style="flex-grow: 1"></div>
|
<div style="flex-grow: 1"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -34,34 +34,40 @@ function changeCustomCSS(cssText: string) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-input
|
<el-form class="manage-container">
|
||||||
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-input
|
||||||
type="textarea"
|
class="imput-line"
|
||||||
show-word-limit
|
type="textarea"
|
||||||
maxlength="1024"
|
show-word-limit
|
||||||
v-model="siteSetting.footer"
|
maxlength="1024"
|
||||||
placeholder="页脚文本(支持HTML)"
|
autosize
|
||||||
@change="changeFooterHTML(siteSetting.footer)"
|
v-model="siteSetting.footer"
|
||||||
/>
|
placeholder="页脚文本(支持HTML)"
|
||||||
<el-input
|
@change="changeFooterHTML(siteSetting.footer)"
|
||||||
class="imput-line"
|
/>
|
||||||
type="textarea"
|
<el-input
|
||||||
autosize
|
class="imput-line"
|
||||||
v-model="siteSetting.css"
|
type="textarea"
|
||||||
placeholder="自定义CSS"
|
autosize
|
||||||
@change="changeCustomCSS(siteSetting.css)"
|
v-model="siteSetting.css"
|
||||||
/>
|
placeholder="自定义CSS"
|
||||||
|
@change="changeCustomCSS(siteSetting.css)"
|
||||||
|
/>
|
||||||
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.manage-container {
|
||||||
|
margin-right: 32px;
|
||||||
|
}
|
||||||
.imput-line {
|
.imput-line {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,7 @@
|
|||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped></style>
|
@@ -2,8 +2,10 @@
|
|||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
|
|
||||||
import { globalStore } from "@/api";
|
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 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");
|
const activeName = ref<string>("site");
|
||||||
|
|
||||||
@@ -25,11 +27,15 @@ onMounted(() => {
|
|||||||
<el-tab-pane label="网站设置" name="site">
|
<el-tab-pane label="网站设置" name="site">
|
||||||
<SiteManageComponent />
|
<SiteManageComponent />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="博文设置" name="third">
|
<el-tab-pane label="博文管理" name="third">
|
||||||
<BlogManageComponent />
|
<BlogManageComponent />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="用户设置" name="user">Config</el-tab-pane>
|
<el-tab-pane label="附件管理" name="user">
|
||||||
<el-tab-pane label="评论设置" name="test">Role</el-tab-pane>
|
<AttachManageComponent />
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="用户管理" name="test">
|
||||||
|
<UserManageComponent />
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user