mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
✨ 驱动器无效时, 访问系统设置, 给予异常提示
This commit is contained in:
@@ -3,6 +3,7 @@ package im.zhaojun.zfile.service;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import im.zhaojun.zfile.cache.ZFileCache;
|
||||
import im.zhaojun.zfile.exception.InvalidDriveException;
|
||||
import im.zhaojun.zfile.model.constant.SystemConfigConstant;
|
||||
import im.zhaojun.zfile.model.dto.SystemConfigDTO;
|
||||
import im.zhaojun.zfile.model.dto.SystemFrontConfigDTO;
|
||||
@@ -120,6 +121,9 @@ public class SystemConfigService {
|
||||
BeanUtils.copyProperties(systemConfig, systemFrontConfigDTO);
|
||||
|
||||
DriveConfig driveConfig = driveConfigService.findById(driveId);
|
||||
if (driveConfig == null) {
|
||||
throw new InvalidDriveException("此驱动器不存在或初始化失败, 请检查后台参数配置");
|
||||
}
|
||||
systemFrontConfigDTO.setSearchEnable(driveConfig.getSearchEnable());
|
||||
return systemFrontConfigDTO;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user