build(desktop): 升级 electron-shell 版本至 1.6.3 并调整插件执行超时配置

- 插件执行超时默认延长至 6 小时,支持插件单独配置超时时间
- 新增插件根目录迁移逻辑,解决旧版权限问题
- 新增多个服务端实体、DTO、配置模块等基础代码
- 新增插件 UI 模板及相关静态资源
This commit is contained in:
2026-10-15 11:38:45 +08:00
parent 872d3dc5c8
commit f0a94bf523
717 changed files with 88647 additions and 17543 deletions
@@ -0,0 +1,66 @@
import * as path from 'path';
import * as os from 'os';
import * as md5 from 'md5';
import * as fs from 'fs';
/**
* 获得配置文件中的 keys
* @returns
*/
const getKeys = () => {
const configFile = path.join(__dirname, '../config/config.default.js');
const configContent = fs.readFileSync(configFile, 'utf8');
const keys = configContent.match(/keys: '([^']+)'/)?.[1];
return keys;
};
/**
* 项目数据目录
* @returns
*/
export const pDataPath = () => {
const dirPath = path.join(os.homedir(), '.cool-admin', md5(getKeys()));
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath, { recursive: true });
}
return dirPath;
};
/**
* 上传目录
* @returns
*/
export const pUploadPath = () => {
const uploadPath = path.join(pDataPath(), 'upload');
if (!fs.existsSync(uploadPath)) {
fs.mkdirSync(uploadPath, { recursive: true });
}
return uploadPath;
};
/**
* 插件目录
* @returns
*/
export const pPluginPath = () => {
const pluginPath = path.join(pDataPath(), 'plugin');
if (!fs.existsSync(pluginPath)) {
fs.mkdirSync(pluginPath, { recursive: true });
}
return pluginPath;
};
/**
* sqlite 数据库文件
*/
export const pSqlitePath = () => {
return path.join(pDataPath(), 'cool.sqlite');
};
/**
* 缓存目录
* @returns
*/
export const pCachePath = () => {
return path.join(pDataPath(), 'cache');
};