修改缓存文件夹位置
This commit is contained in:
@@ -14,8 +14,8 @@ class CacheConfigManager {
|
|||||||
// 在打包环境中,使用可执行文件所在目录
|
// 在打包环境中,使用可执行文件所在目录
|
||||||
this.configPath = path.join(process.cwd(), 'data', 'cache-config.json');
|
this.configPath = path.join(process.cwd(), 'data', 'cache-config.json');
|
||||||
} else {
|
} else {
|
||||||
// 在开发环境中,使用相对路径
|
// 在开发环境中,使用项目根目录的data文件夹
|
||||||
this.configPath = path.join(__dirname, 'cache-config.json');
|
this.configPath = path.join(__dirname, '..', '..', 'data', 'cache-config.json');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 确保路径是绝对路径
|
// 确保路径是绝对路径
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ class ImageCacheService {
|
|||||||
// 在打包环境中,使用可执行文件所在目录
|
// 在打包环境中,使用可执行文件所在目录
|
||||||
this.cacheDir = path.join(process.cwd(), 'data', 'image-cache');
|
this.cacheDir = path.join(process.cwd(), 'data', 'image-cache');
|
||||||
} else {
|
} else {
|
||||||
// 在开发环境中,使用相对路径
|
// 在开发环境中,使用项目根目录的data文件夹
|
||||||
this.cacheDir = path.join(__dirname, '..', 'data', 'image-cache');
|
this.cacheDir = path.join(__dirname, '..', '..', 'data', 'image-cache');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 确保路径是绝对路径
|
// 确保路径是绝对路径
|
||||||
|
|||||||
Reference in New Issue
Block a user