mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
✨ debug 模式优化, 增加到系统参数接口中
This commit is contained in:
@@ -6,6 +6,7 @@ import im.zhaojun.zfile.service.SystemConfigService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@@ -18,6 +19,7 @@ public class DebugController {
|
||||
@Resource
|
||||
private SystemConfigService systemConfigService;
|
||||
|
||||
@ResponseBody
|
||||
@GetMapping("/debug/resetPwd")
|
||||
public ResultBean resetPwd() {
|
||||
if (debug) {
|
||||
|
||||
@@ -41,6 +41,9 @@ import java.util.Objects;
|
||||
@RestController
|
||||
public class FileController {
|
||||
|
||||
@Value("${zfile.debug}")
|
||||
private Boolean debug;
|
||||
|
||||
@Resource
|
||||
private SystemConfigService systemConfigService;
|
||||
|
||||
@@ -115,7 +118,7 @@ public class FileController {
|
||||
@GetMapping("/config/{driveId}")
|
||||
public ResultBean getConfig(@PathVariable(name = "driveId") Integer driveId, String path) {
|
||||
SystemFrontConfigDTO systemConfig = systemConfigService.getSystemFrontConfig(driveId);
|
||||
|
||||
systemConfig.setDebugMode(debug);
|
||||
AbstractBaseFileService fileService = driveContext.get(driveId);
|
||||
DriveConfig driveConfig = driveConfigService.findById(driveId);
|
||||
String fullPath = StringUtils.removeDuplicateSeparator(path + ZFileConstant.PATH_SEPARATOR + ZFileConstant.README_FILE_NAME);
|
||||
|
||||
@@ -41,4 +41,6 @@ public class SystemFrontConfigDTO {
|
||||
|
||||
private String readme;
|
||||
|
||||
private Boolean debugMode;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user