fix(biji): 优化笔记编辑器自动保存机制并修复相关问题
- 实现了更可靠的自动保存功能,仅在用户停止输入后触发保存操作 - 修复了切换笔记时意外触发自动保存的问题 - 优化了重命名文件后的预览更新逻辑 - 调整了保存成功后的状态清理策略,提高了用户体验
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.test.bijihoudaun.controller;
|
||||
|
||||
import com.test.bijihoudaun.common.response.R;
|
||||
import com.test.bijihoudaun.service.ImageCleanupService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -25,8 +26,8 @@ public class ImageCleanupController {
|
||||
*/
|
||||
@PostMapping("/cleanup-images")
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
public ResponseEntity<?> cleanupImages() {
|
||||
public R<?> cleanupImages() {
|
||||
int deletedCount = imageCleanupService.cleanupRedundantImages();
|
||||
return ResponseEntity.ok().body("成功清理 " + deletedCount + " 个冗余图片");
|
||||
return R.success("成功清理 " + deletedCount + " 个冗余图片");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,10 +93,10 @@ public class MarkdownController {
|
||||
}
|
||||
|
||||
@Operation(summary = "更新Markdown文件标题")
|
||||
@PutMapping("/{id}/title")
|
||||
@PostMapping("/{id}/title")
|
||||
public R<MarkdownFile> updateMarkdownTitle(
|
||||
@PathVariable Long id,
|
||||
@RequestBody String title) {
|
||||
String title) {
|
||||
MarkdownFile updatedFile = markdownFileService.updateMarkdownTitle(id, title);
|
||||
if (ObjectUtil.isNotNull(updatedFile)) {
|
||||
return R.success(updatedFile);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: org.sqlite.JDBC
|
||||
url: jdbc:sqlite:C:\it\houtaigunli\biji\mydatabase.db
|
||||
# url: jdbc:sqlite:C:\KAIFA\2\mydatabase.db
|
||||
# url: jdbc:sqlite:C:\it\houtaigunli\biji\mydatabase.db
|
||||
url: jdbc:sqlite:C:\KAIFA\2\mydatabase.db
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: none
|
||||
|
||||
@@ -15,4 +15,8 @@ spring:
|
||||
|
||||
# 禁用Knife4j
|
||||
knife4j:
|
||||
enable: false
|
||||
enable: false
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 10MB
|
||||
Reference in New Issue
Block a user