debug 模式优化, 增加到系统参数接口中

This commit is contained in:
zhaojun1998
2021-02-24 18:39:47 +08:00
parent c14b8343d2
commit 410a87c426
3 changed files with 8 additions and 1 deletions

View File

@@ -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) {

View File

@@ -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);

View File

@@ -41,4 +41,6 @@ public class SystemFrontConfigDTO {
private String readme;
private Boolean debugMode;
}