Compare commits

..

7 Commits
1.9 ... 2.0

Author SHA1 Message Date
zhaojun1998
7bf3a29c17 🔖 发布 2.0 版 2020-02-29 15:48:57 +08:00
zhaojun1998
6ee5002f0c 🔒 修复任意用户名均可登陆后台的安全问题. 2020-02-29 15:47:24 +08:00
zhaojun1998
fadc64add4 💄 更新页面, 修复滚动分页 BUG. 2020-02-29 15:46:56 +08:00
zhaojun1998
234f43846f 优化分页功能 2020-02-29 15:45:34 +08:00
zhaojun1998
67e42d9753 🐛 修复 OneDrive 获取文档区或文件夹密码时, 链接超时导致异常的 BUG. 2020-02-29 15:45:11 +08:00
zhaojun1998
04f94b4bf5 🏗️ 缓存架构调整, 增强稳定性 2020-02-29 15:43:56 +08:00
zhaojun1998
d29c498457 更新配置自描述文件 2020-02-27 23:01:38 +08:00
54 changed files with 417 additions and 291 deletions

View File

@@ -12,7 +12,7 @@
<groupId>im.zhaojun</groupId>
<artifactId>zfile</artifactId>
<version>1.9</version>
<version>2.0</version>
<name>zfile</name>
<packaging>war</packaging>
<description>一个在线的文件浏览系统</description>

View File

@@ -3,13 +3,11 @@ package im.zhaojun.common.cache;
import cn.hutool.core.util.StrUtil;
import im.zhaojun.common.model.dto.FileItemDTO;
import im.zhaojun.common.model.dto.SystemConfigDTO;
import im.zhaojun.common.model.enums.FileTypeEnum;
import im.zhaojun.common.service.SystemConfigService;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -21,22 +19,14 @@ public class ZFileCache {
private ConcurrentMap<String, List<FileItemDTO>> fileCache = new ConcurrentHashMap<>();
private ConcurrentMap<String, Integer> fileCountCache = new ConcurrentHashMap<>();
private SystemConfigDTO systemConfigCache;
public static final String CACHE_FILE_COUNT_KEY = "file-count";
public Date lastCacheAutoRefreshDate;
public static final String CACHE_DIRECTORY_COUNT_KEY = "directory-count";
@Resource
private SystemConfigService systemConfigService;
public synchronized void put(String key, List<FileItemDTO> value) {
for (FileItemDTO fileItemDTO : value) {
if (FileTypeEnum.FILE.equals(fileItemDTO.getType())) {
incrCacheFileCount();
} else {
incrCacheDirectoryCount();
}
}
fileCache.put(key, value);
}
@@ -46,10 +36,9 @@ public class ZFileCache {
public void clear() {
fileCache.clear();
fileCountCache.clear();
}
public long cacheCount() {
public int cacheCount() {
return fileCache.size();
}
@@ -83,24 +72,6 @@ public class ZFileCache {
fileCache.remove(key);
}
private void incrCacheFileCount() {
Integer originValue = fileCountCache.getOrDefault(CACHE_FILE_COUNT_KEY, 0);
fileCountCache.put(CACHE_FILE_COUNT_KEY, originValue + 1);
}
private void incrCacheDirectoryCount() {
Integer originValue = fileCountCache.getOrDefault(CACHE_DIRECTORY_COUNT_KEY, 0);
fileCountCache.put(CACHE_DIRECTORY_COUNT_KEY, originValue + 1);
}
public int getCacheFileCount() {
return fileCountCache.getOrDefault(CACHE_FILE_COUNT_KEY, 0);
}
public int getCacheDirectorCount() {
return fileCountCache.getOrDefault(CACHE_DIRECTORY_COUNT_KEY, 0);
}
public void updateConfig(SystemConfigDTO systemConfigCache) {
this.systemConfigCache = systemConfigCache;
}
@@ -112,4 +83,12 @@ public class ZFileCache {
public void removeConfig() {
this.systemConfigCache = null;
}
public Date getLastCacheAutoRefreshDate() {
return lastCacheAutoRefreshDate;
}
public void setLastCacheAutoRefreshDate(Date lastCacheAutoRefreshDate) {
this.lastCacheAutoRefreshDate = lastCacheAutoRefreshDate;
}
}

View File

@@ -45,26 +45,33 @@ public class GlobalScheduleTask {
@Scheduled(fixedRate = 1000 * 60 * 10, initialDelay = 1000 * 30)
public void autoRefreshOneDriveToken() {
AbstractFileService currentFileService = systemConfigService.getCurrentFileService();
if (!(currentFileService instanceof OneDriveServiceImpl
|| currentFileService instanceof OneDriveChinaServiceImpl)) {
log.debug("当前启用存储类型, 不是 OneDrive, 跳过自动刷新 AccessToken");
return;
}
if (currentFileService.getIsUnInitialized()) {
log.debug("当前启用 OneDrive 未初始化成功, 跳过自动刷新 AccessToken");
return;
}
StorageTypeEnum currentStorageTypeEnum = currentFileService.getStorageTypeEnum();
try {
refreshOneDriveToken(currentStorageTypeEnum);
} catch (Exception e) {
log.debug("刷新 " + currentStorageTypeEnum.getDescription() + " Token 失败.", e);
log.debug("尝试调用 OneDrive 自动刷新 AccessToken 定时任务");
AbstractFileService currentFileService = systemConfigService.getCurrentFileService();
if (!(currentFileService instanceof OneDriveServiceImpl
|| currentFileService instanceof OneDriveChinaServiceImpl)) {
log.debug("当前启用存储类型, 不是 OneDrive, 跳过自动刷新 AccessToken");
return;
}
if (currentFileService.getIsUnInitialized()) {
log.debug("当前启用 OneDrive 未初始化成功, 跳过自动刷新 AccessToken");
return;
}
StorageTypeEnum currentStorageTypeEnum = currentFileService.getStorageTypeEnum();
try {
refreshOneDriveToken(currentStorageTypeEnum);
} catch (Exception e) {
log.debug("刷新 " + currentStorageTypeEnum.getDescription() + " Token 失败.", e);
}
} catch (Throwable e) {
log.debug("尝试调用 OneDrive 自动刷新 AccessToken 定时任务出现未知异常", e);
}
}
/**

View File

@@ -17,20 +17,13 @@ import im.zhaojun.common.util.FileUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.concurrent.ScheduledExecutorService;
/**
* 后台管理
@@ -51,6 +44,8 @@ public class AdminController {
@Resource
private FileAsyncCacheService fileAsyncCacheService;
private ScheduledExecutorService scheduledExecutorService;
/**
* 获取系统配置
*/
@@ -65,18 +60,20 @@ public class AdminController {
*/
@PostMapping("/config")
public ResultBean updateConfig(SystemConfigDTO systemConfigDTO) throws Exception {
AbstractFileService currentFileService = systemConfigService.getCurrentFileService();
systemConfigDTO.setId(1);
systemConfigService.updateSystemConfig(systemConfigDTO);
StorageTypeEnum currentStorageStrategy = currentFileService.getStorageTypeEnum();
StorageTypeEnum currentStorageStrategy = systemConfigService.getCurrentStorageStrategy();
if (!Objects.equals(currentStorageStrategy, systemConfigDTO.getStorageStrategy())) {
if (systemConfigService.getEnableCache()) {
return ResultBean.error("不支持缓存开启状态下, 切换存储策略, 请先手动关闭缓存");
}
log.info("已将存储策略由 {} 切换为 {}",
currentStorageStrategy.getDescription(),
systemConfigDTO.getStorageStrategy().getDescription());
refreshStorageStrategy();
}
systemConfigDTO.setId(1);
systemConfigService.updateSystemConfig(systemConfigDTO);
return ResultBean.success();
}
@@ -161,7 +158,7 @@ public class AdminController {
/**
* 更新存储策略
*/
public void refreshStorageStrategy() throws Exception {
public void refreshStorageStrategy() {
StorageTypeEnum storageStrategy = systemConfigService.getCurrentStorageStrategy();
refreshStorageStrategy(storageStrategy);
}
@@ -169,7 +166,7 @@ public class AdminController {
/**
* 更新存储策略
*/
public void refreshStorageStrategy(StorageTypeEnum storageStrategy) throws Exception {
private void refreshStorageStrategy(StorageTypeEnum storageStrategy) {
if (storageStrategy == null) {
log.info("尚未配置存储策略.");
} else {

View File

@@ -35,13 +35,13 @@ public class CacheController {
private ZFileCache zFileCache;
@PostMapping("/enable")
public ResultBean enableCache() throws Exception {
public ResultBean enableCache() {
fileCacheService.enableCache();
return ResultBean.success();
}
@PostMapping("/disable")
public ResultBean disableCache() throws Exception {
public ResultBean disableCache() {
fileCacheService.disableCache();
return ResultBean.success();
}
@@ -53,11 +53,12 @@ public class CacheController {
cacheConfigDTO.setEnableCache(systemConfigService.getEnableCache());
cacheConfigDTO.setCacheFinish(fileAsyncCacheService.isCacheFinish());
cacheConfigDTO.setCacheKeys(zFileCache.keySet());
cacheConfigDTO.setCacheDirectoryCount(zFileCache.getCacheDirectorCount());
cacheConfigDTO.setCacheFileCount(zFileCache.getCacheFileCount());
cacheConfigDTO.setCacheDirectoryCount(zFileCache.cacheCount());
cacheConfigDTO.setLastCacheAutoRefreshDate(zFileCache.getLastCacheAutoRefreshDate());
return ResultBean.success(cacheConfigDTO);
}
/*
@PostMapping("/refresh")
public ResultBean refreshCache(String key) throws Exception {
AbstractFileService fileService = systemConfigService.getCurrentFileService();
@@ -66,14 +67,15 @@ public class CacheController {
}
@PostMapping("/clear")
public ResultBean clearCache(String key) throws Exception {
public ResultBean clearCache(String key) {
AbstractFileService fileService = systemConfigService.getCurrentFileService();
fileService.clearFileCache();
return ResultBean.success();
}
*/
@PostMapping("/all")
public ResultBean cacheAll() throws Exception {
public ResultBean cacheAll() {
AbstractFileService fileService = systemConfigService.getCurrentFileService();
fileService.clearFileCache();
fileAsyncCacheService.cacheGlobalFile();

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.URLUtil;
import im.zhaojun.common.annotation.CheckStorageStrategyInit;
import im.zhaojun.common.exception.SearchDisableException;
import im.zhaojun.common.model.FilePageModel;
import im.zhaojun.common.model.constant.ZFileConstant;
import im.zhaojun.common.model.dto.FileItemDTO;
import im.zhaojun.common.model.dto.ResultBean;
@@ -16,21 +17,21 @@ import im.zhaojun.common.service.SystemService;
import im.zhaojun.common.util.FileComparator;
import im.zhaojun.common.util.HttpUtil;
import im.zhaojun.common.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.HttpClientErrorException;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.*;
/**
* 前台文件管理
* @author zhaojun
*/
@Slf4j
@RequestMapping("/api")
@RestController
public class FileController {
@@ -59,17 +60,34 @@ public class FileController {
AbstractFileService fileService = systemConfigService.getCurrentFileService();
List<FileItemDTO> fileItemList = fileService.fileList(StringUtils.removeDuplicateSeparator("/" + path + "/"));
for (FileItemDTO fileItemDTO : fileItemList) {
if (ZFileConstant.PASSWORD_FILE_NAME.equals(fileItemDTO.getName())
&& !HttpUtil.getTextContent(fileItemDTO.getUrl()).equals(password)) {
if (ZFileConstant.PASSWORD_FILE_NAME.equals(fileItemDTO.getName())) {
String expectedPasswordContent = null;
try {
expectedPasswordContent = HttpUtil.getTextContent(fileItemDTO.getUrl() + '1');
} catch (HttpClientErrorException httpClientErrorException) {
log.debug("尝试重新获取密码文件缓存中链接后仍失败", httpClientErrorException);
try {
String fullPath = StringUtils.removeDuplicateSeparator(fileItemDTO.getPath() + "/" + fileItemDTO.getName());
FileItemDTO fileItem = fileService.getFileItem(fullPath);
expectedPasswordContent = HttpUtil.getTextContent(fileItem.getUrl());
} catch (Exception e) {
log.debug("尝试重新获取密码文件链接后仍失败, 已暂时取消密码", e);
break;
}
}
if (Objects.equals(expectedPasswordContent, password)) {
break;
}
if (password != null && !"".equals(password)) {
return ResultBean.error("密码错误.");
return ResultBean.error("密码错误.", ResultBean.INVALID_PASSWORD);
}
return ResultBean.error("此文件夹需要密码.", ResultBean.REQUIRED_PASSWORD);
}
}
List<FileItemDTO> sortedPagingData = getSortedPagingData(fileItemList, page);
return ResultBean.successData(sortedPagingData);
return ResultBean.successData(getSortedPagingData(fileItemList, page));
}
@@ -101,8 +119,7 @@ public class FileController {
throw new SearchDisableException("搜索功能缓存预热中, 请稍后再试");
}
List<FileItemDTO> fileItemList = fileService.search(URLUtil.decode(name));
List<FileItemDTO> sortedPagingData = getSortedPagingData(fileItemList, page);
return ResultBean.successData(sortedPagingData);
return ResultBean.successData(getSortedPagingData(fileItemList, page));
}
@@ -119,7 +136,7 @@ public class FileController {
}
private List<FileItemDTO> getSortedPagingData(List<FileItemDTO> fileItemList, Integer page) {
private FilePageModel getSortedPagingData(List<FileItemDTO> fileItemList, Integer page) {
ArrayList<FileItemDTO> copy = new ArrayList<>(Arrays.asList(new FileItemDTO[fileItemList.size()]));
Collections.copy(copy, fileItemList);
@@ -131,13 +148,13 @@ public class FileController {
int totalPage = (total + PAGE_SIZE - 1) / PAGE_SIZE;
if (page > totalPage) {
return new ArrayList<>();
return new FilePageModel(total, totalPage, Collections.emptyList());
}
int start = (page - 1) * PAGE_SIZE;
int end = page * PAGE_SIZE;
end = Math.min(end, total);
return new ArrayList<>(copy.subList(start, end));
return new FilePageModel(total, totalPage, copy.subList(start, end));
}

View File

@@ -0,0 +1,22 @@
package im.zhaojun.common.model;
import im.zhaojun.common.model.dto.FileItemDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
/**
* @author zhaojun
*/
@Data
@AllArgsConstructor
public class FilePageModel {
private int total;
private int totalPage;
private List<FileItemDTO> fileList;
}

View File

@@ -2,6 +2,7 @@ package im.zhaojun.common.model.dto;
import lombok.Data;
import java.util.Date;
import java.util.Set;
/**
@@ -14,4 +15,5 @@ public class CacheConfigDTO {
private Set<String> cacheKeys;
private Integer cacheDirectoryCount;
private Integer cacheFileCount;
private Date lastCacheAutoRefreshDate;
}

View File

@@ -15,12 +15,16 @@ public class ResultBean implements Serializable {
public static final int REQUIRED_PASSWORD = -2;
public static final int INVALID_PASSWORD = -3;
private String msg = "操作成功";
private int code = SUCCESS;
private Object data;
private int total;
private ResultBean() {
super();
}
@@ -43,6 +47,10 @@ public class ResultBean implements Serializable {
return success("操作成功", data);
}
public static ResultBean successPage(Object data, Long total) {
return success("操作成功", data);
}
public static ResultBean success(Object data) {
return success("操作成功", data);
}

View File

@@ -9,6 +9,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.Objects;
/**
* @author zhaojun
@@ -24,6 +25,9 @@ public class MyUserDetailsServiceImpl implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
SystemConfigDTO systemConfig = systemConfigService.getSystemConfig();
if (!Objects.equals(systemConfig.getUsername(), username)) {
throw new UsernameNotFoundException("用户名不存在");
}
return new User(systemConfig.getUsername(), systemConfig.getPassword(), Collections.emptyList());
}
}

View File

@@ -52,13 +52,10 @@ public abstract class AbstractFileService extends FileCacheService implements Fi
/**
* 清理当前存储策略的缓存
* 1. 删除全部缓存
* 2. 关闭自动刷新
* 3. 重置缓存个数
* 4. 标记为当前处于未完成缓存状态
* 2. 标记为当前处于未完成缓存状态
*/
public void clearFileCache() {
zFileCache.clear();
closeCacheAutoRefresh();
fileAsyncCacheService.setCacheFinish(false);
}
@@ -141,15 +138,6 @@ public abstract class AbstractFileService extends FileCacheService implements Fi
currentFileService.fileList(key);
}
public void closeCacheAutoRefresh() {
// cache.config().setRefreshPolicy(null);
}
public void openCacheAutoRefresh() {
// RefreshPolicy refreshPolicy = RefreshPolicy.newPolicy(30, TimeUnit.MINUTES);
// cache.config().setRefreshPolicy(refreshPolicy);
}
public abstract FileItemDTO getFileItem(String path);
}

View File

@@ -1,17 +1,21 @@
package im.zhaojun.common.service;
import im.zhaojun.common.cache.ZFileCache;
import im.zhaojun.common.config.StorageTypeFactory;
import im.zhaojun.common.model.dto.FileItemDTO;
import im.zhaojun.common.model.enums.FileTypeEnum;
import im.zhaojun.common.model.enums.StorageTypeEnum;
import im.zhaojun.common.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayDeque;
import java.util.List;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* @author zhaojun
@@ -27,8 +31,23 @@ public class FileAsyncCacheService {
@Resource
private SystemConfigService systemConfigService;
private volatile boolean stopFlag = false;
@Resource
private ZFileCache zFileCache;
@Value("${zfile.cache.auto-refresh.enable}")
protected boolean enableAutoRefreshCache;
@Value("${zfile.cache.auto-refresh.delay}")
protected Long delay;
@Value("${zfile.cache.auto-refresh.interval}")
protected Long interval;
@Async
public void cacheGlobalFile() {
stopFlag = false;
StorageTypeEnum storageStrategy = systemConfigService.getCurrentStorageStrategy();
if (storageStrategy == null) {
@@ -61,6 +80,11 @@ public class FileAsyncCacheService {
while (!queue.isEmpty()) {
FileItemDTO fileItemDTO = queue.pop();
if (stopFlag) {
zFileCache.clear();
break;
}
if (fileItemDTO.getType() == FileTypeEnum.FOLDER) {
String filePath = StringUtils.removeDuplicateSeparator("/" + fileItemDTO.getPath() + "/" + fileItemDTO.getName() + "/");
@@ -73,10 +97,82 @@ public class FileAsyncCacheService {
e.printStackTrace();
}
long endTime = System.currentTimeMillis();
log.info("缓存 {} 所有文件结束, 用时: {} 秒", storageStrategy.getDescription(), ((endTime - startTime) / 1000));
cacheFinish = true;
if (stopFlag) {
log.info("缓存 {} 所有文件被强制结束, 用时: {} 秒", storageStrategy.getDescription(), ((endTime - startTime) / 1000));
cacheFinish = false;
stopFlag = false;
} else {
log.info("缓存 {} 所有文件结束, 用时: {} 秒", storageStrategy.getDescription(), ((endTime - startTime) / 1000));
enableCacheAutoRefreshTask();
cacheFinish = true;
stopFlag = false;
}
}
private void enableCacheAutoRefreshTask() {
StorageTypeEnum currentStorageStrategy = systemConfigService.getCurrentStorageStrategy();
if (enableAutoRefreshCache) {
ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
scheduledExecutorService.scheduleWithFixedDelay(() -> {
zFileCache.setLastCacheAutoRefreshDate(new Date());
boolean enableCache = systemConfigService.getEnableCache();
if (!enableCache) {
log.debug("当前存储引擎未开启缓存, 跳过自动刷新缓存");
zFileCache.clear();
return;
}
log.debug("开始调用自动刷新缓存");
Set<String> keySet = zFileCache.keySet();
ArrayList<String> keys = new ArrayList<>(keySet);
for (String key : keys) {
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (stopFlag) {
break;
}
zFileCache.remove(key);
AbstractFileService currentFileService = systemConfigService.getCurrentFileService();
try {
if (Objects.equals(currentStorageStrategy, systemConfigService.getCurrentStorageStrategy())) {
currentFileService.fileList(key);
}
} catch (Exception e) {
log.error("刷新过程中出错 : [" + key + "]", e);
}
}
if (stopFlag) {
log.debug("检测到停止 [{}] 缓存指令, 已停止自动刷新任务", currentStorageStrategy);
scheduledExecutorService.shutdownNow();
stopFlag = false;
} else {
log.debug("自动刷新缓存完成");
}
}, delay, interval, TimeUnit.SECONDS);
}
}
public void stopScheduled() {
this.stopFlag = true;
}
public void enableScheduled() {
this.stopFlag = false;
}
public boolean isCacheFinish() {
return cacheFinish;

View File

@@ -1,5 +1,6 @@
package im.zhaojun.common.service;
import im.zhaojun.common.cache.ZFileCache;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@@ -18,19 +19,19 @@ public class FileCacheService {
@Lazy
private FileAsyncCacheService fileAsyncCacheService;
@Resource
private ZFileCache zFileCache;
public void enableCache() {
systemConfigService.updateCacheEnableConfig(true);
AbstractFileService currentFileService = systemConfigService.getCurrentFileService();
currentFileService.openCacheAutoRefresh();
fileAsyncCacheService.cacheGlobalFile();
}
public void disableCache() throws Exception {
public void disableCache() {
systemConfigService.updateCacheEnableConfig(false);
AbstractFileService currentFileService = systemConfigService.getCurrentFileService();
currentFileService.clearFileCache();
zFileCache.clear();
fileAsyncCacheService.setCacheFinish(false);
fileAsyncCacheService.stopScheduled();
}
}

View File

@@ -89,22 +89,8 @@ public class SystemConfigService {
}
}
boolean oldEnableCache = getEnableCache();
boolean curEnableCache = BooleanUtil.isTrue(systemConfigDTO.getEnableCache());
zFileCache.removeConfig();
systemConfigRepository.saveAll(systemConfigList);
if (!oldEnableCache && curEnableCache) {
log.debug("检测到开启了缓存, 开启预热缓存");
fileCacheService.enableCache();
}
if (oldEnableCache && !curEnableCache) {
log.debug("检测到关闭了缓存, 正在清理缓存数据及关闭自动刷新");
fileCacheService.disableCache();
}
}

View File

@@ -5,7 +5,10 @@ import im.zhaojun.common.model.dto.FileItemDTO;
import im.zhaojun.common.model.dto.SiteConfigDTO;
import im.zhaojun.common.model.enums.StorageTypeEnum;
import im.zhaojun.common.util.HttpUtil;
import im.zhaojun.common.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.client.HttpClientErrorException;
import javax.annotation.Resource;
import java.util.ArrayList;
@@ -15,6 +18,7 @@ import java.util.Objects;
/**
* @author zhaojun
*/
@Slf4j
@Service
public class SystemService {
@@ -40,7 +44,20 @@ public class SystemService {
for (FileItemDTO fileItemDTO : fileItemList) {
if (ZFileConstant.README_FILE_NAME.equalsIgnoreCase(fileItemDTO.getName())) {
siteConfigDTO.setReadme(HttpUtil.getTextContent(fileItemDTO.getUrl()));
String textContent = null;
try {
textContent = HttpUtil.getTextContent(fileItemDTO.getUrl());
} catch (HttpClientErrorException httpClientErrorException) {
log.debug("尝试重新获取文档区缓存中链接后仍失败", httpClientErrorException);
try {
String fullPath = StringUtils.removeDuplicateSeparator(fileItemDTO.getPath() + "/" + fileItemDTO.getName());
FileItemDTO fileItem = fileService.getFileItem(fullPath);
textContent = HttpUtil.getTextContent(fileItem.getUrl());
} catch (Exception e) {
log.debug("尝试重新获取文档区链接后仍失败, 已置为空", e);
}
}
siteConfigDTO.setReadme(textContent);
}
}
return siteConfigDTO;

View File

@@ -16,10 +16,7 @@ import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
import java.util.*;
/**
* 项目启动监听器, 当项目启动时, 遍历当前对象存储的所有内容, 添加到缓存中.
@@ -35,18 +32,6 @@ public class StartupListener implements ApplicationListener<ApplicationStartedEv
@Resource
private Environment environment;
@Resource
private ZFileCache zFileCache;
@Value("${zfile.cache.auto-refresh.enable}")
protected boolean enableAutoRefreshCache;
@Value("${zfile.cache.auto-refresh.delay}")
protected Long delay;
@Value("${zfile.cache.auto-refresh.interval}")
protected Long interval;
@Resource
private SystemConfigService systemConfigService;
@@ -54,33 +39,8 @@ public class StartupListener implements ApplicationListener<ApplicationStartedEv
public void onApplicationEvent(@NonNull ApplicationStartedEvent event) {
printStartInfo();
cacheAllFile();
enableCacheAutoRefreshTask();
}
private void enableCacheAutoRefreshTask() {
if (enableAutoRefreshCache) {
new Timer("testTimer").schedule(new TimerTask() {
@SneakyThrows
@Override
public void run() {
boolean enableCache = systemConfigService.getEnableCache();
if (!enableCache) {
return;
}
log.debug("开始调用自动刷新缓存");
Set<String> keySet = zFileCache.keySet();
for (String key : keySet) {
zFileCache.remove(key);
AbstractFileService currentFileService = systemConfigService.getCurrentFileService();
currentFileService.fileList(key);
}
}
}, delay * 1000,interval * 1000);
}
}
private void printStartInfo() {
String serverPort = environment.getProperty("server.port", "8080");

View File

@@ -5,6 +5,21 @@
"type": "java.lang.Long",
"description": "目录缓存过期时间 和 下载地址过期时间. 单位为秒."
},
{
"name": "zfile.cache.auto-refresh.enable",
"type": "java.lang.Boolean",
"description": "是否开启自动刷新缓存."
},
{
"name": "zfile.cache.auto-refresh.delay",
"type": "java.lang.Long",
"description": "启动项目后多久开始自动刷新缓存, 推荐与 interval 一致, 因为项目启动时会缓存所有文件. 单位为秒.."
},
{
"name": "zfile.cache.auto-refresh.interval",
"type": "java.lang.Long",
"description": "任务间隔时间, 也就是每多长时间会自动刷新缓存一次.."
},
{
"name": "zfile.constant.readme",
"type": "java.lang.String",
@@ -36,6 +51,26 @@
"name": "zfile.onedrive.scope",
"type": "java.lang.String",
"description": "OneDrive 认证权限."
},
{
"name": "zfile.onedrive-china.clientId",
"type": "java.lang.String",
"description": "OneDrive China ClientId."
},
{
"name": "zfile.onedrive-china.clientSecret",
"type": "java.lang.String",
"description": "OneDrive China ClientSecret."
},
{
"name": "zfile.onedrive-china.redirectUri",
"type": "java.lang.String",
"description": "OneDrive China 认证重定向地址."
},
{
"name": "zfile.onedrive-china.scope",
"type": "java.lang.String",
"description": "OneDrive China 认证权限."
}
]
}

View File

@@ -1,5 +1,5 @@
server:
port: 8080
port: 8081
servlet:
context-path: ''
tomcat:
@@ -47,14 +47,14 @@ spring:
chain:
gzipped: true
profiles:
active: prod
active: dev
zfile:
cache:
auto-refresh:
enable: true # 是否开启自动刷新缓存.
delay: 1800 # 启动项目后多久开始自动刷新缓存, 推荐与 interval 一致, 因为项目启动时会缓存所有文件.
interval: 1800 # 任务间隔时间, 也就是每多长时间会自动刷新缓存一次.
delay: 60000 # 启动项目后多久开始自动刷新缓存, 推荐与 interval 一致, 因为项目启动时会缓存所有文件. 单位为秒.
interval: 60000 # 任务间隔时间, 也就是每多长时间会自动刷新缓存一次. 单位为秒.
timeout: 1800
constant:
readme: readme.md

View File

@@ -0,0 +1 @@
.el-row[data-v-333298fb]{overflow-y:auto}#siteForm[data-v-333298fb]{margin-top:20px;margin-left:20px}.zfile-word-aux[data-v-333298fb]{margin-left:20px;color:#aaa}

View File

@@ -1 +0,0 @@
.el-row[data-v-0d37620b]{overflow-y:auto}#siteForm[data-v-0d37620b]{margin-top:20px;margin-left:20px}#siteForm[data-v-0d37620b] .el-select{width:70%}.zfile-word-aux[data-v-0d37620b]{margin-left:20px;color:#aaa}

View File

@@ -0,0 +1 @@
.el-row[data-v-5289a8fc]{padding:20px}.el-form-item[data-v-5289a8fc]{margin-right:50px}.card-title[data-v-5289a8fc]{color:rgba(0,0,0,.45);font-size:14px}.card-content[data-v-5289a8fc]{color:rgba(0,0,0,.85);font-size:25px;line-height:30px}.card-title-button[data-v-5289a8fc]{float:right;padding:3px 0}.table-search-input[data-v-5289a8fc]{width:300px;float:right}

View File

@@ -1 +0,0 @@
.el-menu[data-v-7e0eaa89],.el-row[data-v-7e0eaa89]{height:100vh}

View File

@@ -0,0 +1 @@
.zfile-header[data-v-38be2320]{height:48px;line-height:48px!important;background:#fafafa;border-bottom:1px solid rgba(0,0,0,.05);padding-left:30px}.zfile-header .el-breadcrumb[data-v-38be2320],.zfile-header .el-input[data-v-38be2320]{line-height:48px}@media only screen and (max-width:767px){.hidden-xs-only{display:none!important}}@media only screen and (min-width:768px){.hidden-sm-and-up{display:none!important}}@media only screen and (min-width:768px) and (max-width:991px){.hidden-sm-only{display:none!important}}@media only screen and (max-width:991px){.hidden-sm-and-down{display:none!important}}@media only screen and (min-width:992px){.hidden-md-and-up{display:none!important}}@media only screen and (min-width:992px) and (max-width:1199px){.hidden-md-only{display:none!important}}@media only screen and (max-width:1199px){.hidden-md-and-down{display:none!important}}@media only screen and (min-width:1200px){.hidden-lg-and-up{display:none!important}}@media only screen and (min-width:1200px) and (max-width:1919px){.hidden-lg-only{display:none!important}}@media only screen and (max-width:1919px){.hidden-lg-and-down{display:none!important}}@media only screen and (min-width:1920px){.hidden-xl-only{display:none!important}}#List[data-v-089e9388]{overflow:hidden}.el-table[data-v-089e9388]{margin:20px 0 0 20px;padding-right:30px;overflow-y:hidden}.el-table[data-v-089e9388]:before{height:0}.el-table svg[data-v-089e9388]{font-size:18px;margin-right:15px}#ListTable[data-v-089e9388] .table-header-left{margin-left:38px}#ListTable[data-v-089e9388] tr{cursor:pointer}.el-scrollbar[data-v-089e9388] .el-scrollbar__wrap{overflow-x:hidden!important}#videoDialog[data-v-089e9388] .el-dialog__body{padding:10px 0 0 0}#List[data-v-089e9388] .el-dialog__header{text-align:center;margin-bottom:-10px;padding:5px 0 5px 0}#videoDialog[data-v-089e9388] .el-dialog__headerbtn{top:10px}#textDialog[data-v-089e9388] .el-dialog{margin-bottom:0}.v-contextmenu-item[data-v-089e9388] label{margin-left:10px}@media screen and (max-device-width:1920px){#videoDialog[data-v-089e9388] .el-dialog{margin-top:5vh!important;width:70%!important}}@media screen and (max-device-width:769px){#videoDialog[data-v-089e9388] .el-dialog{margin-top:10vh!important;width:90%!important}}.operator-btn[data-v-089e9388]{color:#1e9fff;margin-right:20px;font-size:16px}#app{font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,"\5FAE\8F6F\96C5\9ED1",Arial,sans-serif;font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50;overflow-x:hidden}body{margin:unset}.icon,body{overflow:hidden}.icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor}::-webkit-scrollbar{width:6px;height:8px;background:rgba(144,147,153,.3)}::-webkit-scrollbar-button:vertical{display:none}::-webkit-scrollbar-corner,::-webkit-scrollbar-track{background-color:#e2e2e2}::-webkit-scrollbar-thumb{border-radius:8px;background-color:#a6a6a6}::-webkit-scrollbar-thumb:vertical:hover{background-color:#7f7f7f}::-webkit-scrollbar-thumb:vertical:active{background-color:rgba(0,0,0,.38)}.center-box-card{width:1100px;margin:0 auto}.markdown-body{height:300px;overflow-y:auto;padding:0!important;min-width:100%!important}.alert{background-color:#f4f4f5;color:#909399;font-size:12px;margin:0 0 0;width:100%;padding:10px 16px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;position:relative;overflow:hidden;opacity:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:opacity .2s;transition:opacity .2s}

View File

@@ -0,0 +1 @@
.el-menu[data-v-e36af7ca],.el-row[data-v-e36af7ca]{height:100vh}

View File

@@ -1 +0,0 @@
.zfile-header[data-v-38be2320]{height:48px;line-height:48px!important;background:#fafafa;border-bottom:1px solid rgba(0,0,0,.05);padding-left:30px}.zfile-header .el-breadcrumb[data-v-38be2320],.zfile-header .el-input[data-v-38be2320]{line-height:48px}@media only screen and (max-width:767px){.hidden-xs-only{display:none!important}}@media only screen and (min-width:768px){.hidden-sm-and-up{display:none!important}}@media only screen and (min-width:768px) and (max-width:991px){.hidden-sm-only{display:none!important}}@media only screen and (max-width:991px){.hidden-sm-and-down{display:none!important}}@media only screen and (min-width:992px){.hidden-md-and-up{display:none!important}}@media only screen and (min-width:992px) and (max-width:1199px){.hidden-md-only{display:none!important}}@media only screen and (max-width:1199px){.hidden-md-and-down{display:none!important}}@media only screen and (min-width:1200px){.hidden-lg-and-up{display:none!important}}@media only screen and (min-width:1200px) and (max-width:1919px){.hidden-lg-only{display:none!important}}@media only screen and (max-width:1919px){.hidden-lg-and-down{display:none!important}}@media only screen and (min-width:1920px){.hidden-xl-only{display:none!important}}#List[data-v-9e7ae082]{overflow:hidden}.el-table[data-v-9e7ae082]{margin:20px 0 30px 20px;padding-right:30px;height:calc(100vh - 80px);overflow-y:auto}.el-table[data-v-9e7ae082]:before{height:0}.el-table svg[data-v-9e7ae082]{font-size:18px;margin-right:15px}#ListTable[data-v-9e7ae082] .table-header-left{margin-left:38px}#ListTable[data-v-9e7ae082] tr{cursor:pointer}.el-scrollbar[data-v-9e7ae082] .el-scrollbar__wrap{overflow-x:hidden!important}#videoDialog[data-v-9e7ae082] .el-dialog__body{padding:10px 0 0 0}#List[data-v-9e7ae082] .el-dialog__header{text-align:center;margin-bottom:-10px;padding:5px 0 5px 0}#videoDialog[data-v-9e7ae082] .el-dialog__headerbtn{top:10px}#textDialog[data-v-9e7ae082] .el-dialog{margin-bottom:0}.v-contextmenu-item[data-v-9e7ae082] label{margin-left:10px}@media screen and (max-device-width:1920px){#videoDialog[data-v-9e7ae082] .el-dialog{margin-top:5vh!important;width:70%!important}}@media screen and (max-device-width:769px){#videoDialog[data-v-9e7ae082] .el-dialog{margin-top:10vh!important;width:90%!important}}.operator-btn[data-v-9e7ae082]{color:#1e9fff;margin-right:20px;font-size:16px}#app{font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,"\5FAE\8F6F\96C5\9ED1",Arial,sans-serif;font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50;overflow-x:hidden}body{margin:unset}.icon,body{overflow:hidden}.icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor}::-webkit-scrollbar{width:6px;height:8px;background:rgba(144,147,153,.3)}::-webkit-scrollbar-button:vertical{display:none}::-webkit-scrollbar-corner,::-webkit-scrollbar-track{background-color:#e2e2e2}::-webkit-scrollbar-thumb{border-radius:8px;background-color:#a6a6a6}::-webkit-scrollbar-thumb:vertical:hover{background-color:#7f7f7f}::-webkit-scrollbar-thumb:vertical:active{background-color:rgba(0,0,0,.38)}.center-box-card{width:1100px;margin:0 auto}.markdown-body{height:300px;overflow-y:auto;padding:0!important;min-width:100%!important}.alert{background-color:#f4f4f5;color:#909399;font-size:12px;margin:0 0 0;width:100%;padding:10px 16px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;position:relative;overflow:hidden;opacity:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:opacity .2s;transition:opacity .2s}

View File

@@ -0,0 +1 @@
.el-row[data-v-30de6894]{overflow-y:auto}#siteForm[data-v-30de6894]{margin-top:20px;margin-left:20px}#siteForm[data-v-30de6894] .el-select{width:70%}.zfile-word-aux[data-v-30de6894]{margin-left:20px;color:#aaa}

View File

@@ -1 +0,0 @@
.el-row[data-v-03e10d42]{padding:20px}.el-form-item[data-v-03e10d42]{margin-right:50px}.card-title[data-v-03e10d42]{color:rgba(0,0,0,.45);font-size:14px}.card-content[data-v-03e10d42]{color:rgba(0,0,0,.85);font-size:25px;line-height:30px}.card-title-button[data-v-03e10d42]{float:right;padding:3px 0}.table-search-input[data-v-03e10d42]{width:300px;float:right}

View File

@@ -1 +0,0 @@
.el-row[data-v-b5cb4b94]{overflow-y:auto}#siteForm[data-v-b5cb4b94]{margin-top:20px;margin-left:20px}.zfile-word-aux[data-v-b5cb4b94]{margin-left:20px;color:#aaa}

View File

@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title></title><link href=/css/chunk-062fc7e8.2929e066.css rel=prefetch><link href=/css/chunk-06f6e882.4c106b9d.css rel=prefetch><link href=/css/chunk-1f0cfb2a.773f5ef1.css rel=prefetch><link href=/css/chunk-227db9c4.091f6ac0.css rel=prefetch><link href=/css/chunk-26a4e90a.c226568b.css rel=prefetch><link href=/css/chunk-28547ac9.d30178ad.css rel=prefetch><link href=/css/chunk-361b31cc.434c5719.css rel=prefetch><link href=/css/chunk-548ba676.5c3079db.css rel=prefetch><link href=/css/chunk-68344377.b2aa0e97.css rel=prefetch><link href=/css/chunk-718902cb.e55a2dd9.css rel=prefetch><link href=/css/chunk-7954ba37.e2df575b.css rel=prefetch><link href=/css/chunk-be932168.c1550f52.css rel=prefetch><link href=/css/chunk-d1e104d6.ecae5695.css rel=prefetch><link href=/css/chunk-ee358022.06a1e4f9.css rel=prefetch><link href=/css/chunk-f8511272.0e88456f.css rel=prefetch><link href=/js/chunk-062fc7e8.c4189f9b.js rel=prefetch><link href=/js/chunk-06f6e882.c8f73adb.js rel=prefetch><link href=/js/chunk-1f0cfb2a.ce3a310a.js rel=prefetch><link href=/js/chunk-227db9c4.ddebed42.js rel=prefetch><link href=/js/chunk-26a4e90a.ae560c29.js rel=prefetch><link href=/js/chunk-28547ac9.8af05f1e.js rel=prefetch><link href=/js/chunk-2d0a43df.0bb25464.js rel=prefetch><link href=/js/chunk-2d0e57ec.56324ec2.js rel=prefetch><link href=/js/chunk-361b31cc.def59776.js rel=prefetch><link href=/js/chunk-548ba676.2d3ac596.js rel=prefetch><link href=/js/chunk-68344377.430c1430.js rel=prefetch><link href=/js/chunk-718902cb.e78de2d7.js rel=prefetch><link href=/js/chunk-7954ba37.274df95f.js rel=prefetch><link href=/js/chunk-be932168.db81f3ec.js rel=prefetch><link href=/js/chunk-d1e104d6.d8d1e048.js rel=prefetch><link href=/js/chunk-ee358022.1b46eb68.js rel=prefetch><link href=/js/chunk-f8511272.86517674.js rel=prefetch><link href=/js/dplayer.acc587f7.js rel=prefetch><link href=/css/app.34f4cf05.css rel=preload as=style><link href=/css/chunk-vendors.eecca45a.css rel=preload as=style><link href=/js/app.d6337fef.js rel=preload as=script><link href=/js/chunk-vendors.fb40f65f.js rel=preload as=script><link href=/css/chunk-vendors.eecca45a.css rel=stylesheet><link href=/css/app.34f4cf05.css rel=stylesheet></head><body><noscript><strong>We're sorry but zfile doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.fb40f65f.js></script><script src=/js/app.d6337fef.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title></title><link href=/css/chunk-049ad60c.8d1c3f59.css rel=prefetch><link href=/css/chunk-06f6e882.4c106b9d.css rel=prefetch><link href=/css/chunk-09797b6e.0e88456f.css rel=prefetch><link href=/css/chunk-0b11d68a.2bc89311.css rel=prefetch><link href=/css/chunk-1f0cfb2a.773f5ef1.css rel=prefetch><link href=/css/chunk-227db9c4.091f6ac0.css rel=prefetch><link href=/css/chunk-28547ac9.d30178ad.css rel=prefetch><link href=/css/chunk-361b31cc.434c5719.css rel=prefetch><link href=/css/chunk-50da9024.6d697acf.css rel=prefetch><link href=/css/chunk-548ba676.5c3079db.css rel=prefetch><link href=/css/chunk-5a048f62.71936c2b.css rel=prefetch><link href=/css/chunk-6b263e10.bc5fc5af.css rel=prefetch><link href=/css/chunk-718902cb.e55a2dd9.css rel=prefetch><link href=/css/chunk-be932168.c1550f52.css rel=prefetch><link href=/css/chunk-d1e104d6.ecae5695.css rel=prefetch><link href=/js/chunk-049ad60c.0b1b3166.js rel=prefetch><link href=/js/chunk-06f6e882.fc195f68.js rel=prefetch><link href=/js/chunk-09797b6e.7b1e5e16.js rel=prefetch><link href=/js/chunk-0b11d68a.d20d6721.js rel=prefetch><link href=/js/chunk-1f0cfb2a.05b8606a.js rel=prefetch><link href=/js/chunk-227db9c4.0342e2c8.js rel=prefetch><link href=/js/chunk-28547ac9.89bfa8e0.js rel=prefetch><link href=/js/chunk-2d0a43df.0bb25464.js rel=prefetch><link href=/js/chunk-2d0e57ec.56324ec2.js rel=prefetch><link href=/js/chunk-361b31cc.ec6b72b5.js rel=prefetch><link href=/js/chunk-50da9024.60ccc699.js rel=prefetch><link href=/js/chunk-548ba676.7767e226.js rel=prefetch><link href=/js/chunk-5a048f62.c7a85d91.js rel=prefetch><link href=/js/chunk-6b263e10.fe00e76b.js rel=prefetch><link href=/js/chunk-718902cb.4d2eda07.js rel=prefetch><link href=/js/chunk-be932168.8a978c33.js rel=prefetch><link href=/js/chunk-d1e104d6.5ae45d97.js rel=prefetch><link href=/css/app.34f4cf05.css rel=preload as=style><link href=/css/chunk-vendors.4a45e43f.css rel=preload as=style><link href=/js/app.5605baab.js rel=preload as=script><link href=/js/chunk-vendors.b5ddaa46.js rel=preload as=script><link href=/css/chunk-vendors.4a45e43f.css rel=stylesheet><link href=/css/app.34f4cf05.css rel=stylesheet></head><body><noscript><strong>We're sorry but zfile doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.b5ddaa46.js></script><script src=/js/app.5605baab.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-26a4e90a"],{"1f8d":function(t,e,i){"use strict";var a=i("872f"),s=i.n(a);s.a},"872f":function(t,e,i){},adf4:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-row",[i("el-col",{attrs:{span:3}},[i("el-menu",{staticClass:"el-menu-vertical-demo",attrs:{"default-active":"/admin"!==this.$route.path?this.$route.path:"/admin/site",router:!0}},[i("el-menu-item",{attrs:{index:"/admin/site"}},[i("i",{staticClass:"el-icon-setting"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("基本设置")])]),i("el-menu-item",{attrs:{index:"/admin/view"}},[i("i",{staticClass:"el-icon-view"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("显示设置")])]),i("el-menu-item",{attrs:{index:"/admin/storage"}},[i("i",{staticClass:"el-icon-s-operation"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("存储策略")])]),i("el-menu-item",{attrs:{index:"/admin/password"}},[i("i",{staticClass:"el-icon-key"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("修改密码")])]),i("el-menu-item",{attrs:{index:"/admin/cache"}},[i("i",{staticClass:"el-icon-collection"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("缓存管理")])]),i("el-menu-item",{attrs:{index:"/admin/api"}},[i("i",{staticClass:"el-icon-document"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("API 文档")])]),i("el-menu-item",{attrs:{index:"/admin/monitor"}},[i("i",{staticClass:"el-icon-monitor"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("系统监控")])])],1)],1),i("el-col",{attrs:{span:16}},[i("keep-alive",{attrs:{exclude:"CacheManager,SiteSetting"}},[i("router-view")],1)],1)],1)},s=[],n={name:"Index",data:function(){return{active:"/admin/storage"}}},l=n,o=(i("1f8d"),i("2877")),r=Object(o["a"])(l,a,s,!1,null,"7e0eaa89",null);e["default"]=r.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5a048f62"],{"0c7e":function(t,e,i){},"8d20":function(t,e,i){"use strict";var s=i("0c7e"),a=i.n(s);a.a},adf4:function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-row",[i("el-col",{attrs:{span:3}},[i("el-menu",{staticClass:"el-menu-vertical-demo",attrs:{"default-active":"/admin"!==this.$route.path?this.$route.path:"/admin/site",router:!0}},[i("el-menu-item",{attrs:{index:"/admin/site"}},[i("i",{staticClass:"el-icon-setting"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("基本设置")])]),i("el-menu-item",{attrs:{index:"/admin/view"}},[i("i",{staticClass:"el-icon-view"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("显示设置")])]),i("el-menu-item",{attrs:{index:"/admin/storage"}},[i("i",{staticClass:"el-icon-s-operation"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("存储策略")])]),i("el-menu-item",{attrs:{index:"/admin/password"}},[i("i",{staticClass:"el-icon-key"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("修改密码")])]),i("el-menu-item",{attrs:{index:"/admin/cache"}},[i("i",{staticClass:"el-icon-collection"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("缓存管理")])]),i("el-menu-item",{attrs:{index:"/admin/api"}},[i("i",{staticClass:"el-icon-document"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("API 文档")])]),i("el-menu-item",{attrs:{index:"/admin/monitor"}},[i("i",{staticClass:"el-icon-monitor"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("系统监控")])]),i("el-menu-item",{on:{click:t.click}},[i("i",{staticClass:"el-icon-s-home"}),i("span",{attrs:{slot:"title"},slot:"title"},[t._v("前往首页")])])],1)],1),i("el-col",{attrs:{span:16}},[i("keep-alive",{attrs:{exclude:"CacheManager,SiteSetting"}},[i("router-view")],1)],1)],1)},a=[],n={name:"Index",data:function(){return{active:"/admin/storage"}},methods:{click:function(){window.open("/","_blank")}}},l=n,o=(i("8d20"),i("2877")),c=Object(o["a"])(l,s,a,!1,null,"e36af7ca",null);e["default"]=c.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long