mirror of
https://github.com/foxhui/WebAI2API.git
synced 2026-06-16 21:03:59 +08:00
fix: 修复在 MacOS 下初始化步骤缺少的问题
This commit is contained in:
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- **后端聚合**
|
||||
- 可根据请求的模型id自动选择可用的适配器且遵循配置文件中的优先级
|
||||
|
||||
### Fixed
|
||||
- **修复杂项**
|
||||
- 修复在 MacOS 下初始化步骤缺少导致的浏览器启动失败
|
||||
|
||||
## [2.2.2] - 2025-12-12
|
||||
|
||||
### Added
|
||||
|
||||
@@ -312,6 +312,24 @@ async function installCamoufox(platform, arch, proxyUrl) {
|
||||
|
||||
await compressing.zip.uncompress(downloadPath, camoufoxDir);
|
||||
|
||||
// macOS 专用:复制 properties.json 到 MacOS 目录
|
||||
if (platform === 'darwin') {
|
||||
const resourcesPath = path.join(camoufoxDir, 'Camoufox.app', 'Contents', 'Resources', 'properties.json');
|
||||
const macOSDir = path.join(camoufoxDir, 'Camoufox.app', 'Contents', 'MacOS');
|
||||
const macOSPath = path.join(macOSDir, 'properties.json');
|
||||
|
||||
if (fs.existsSync(resourcesPath)) {
|
||||
// 确保目标目录存在
|
||||
if (!fs.existsSync(macOSDir)) {
|
||||
fs.mkdirSync(macOSDir, { recursive: true });
|
||||
}
|
||||
fs.copyFileSync(resourcesPath, macOSPath);
|
||||
logger.info('初始化', `已复制 properties.json 到 MacOS 目录`);
|
||||
} else {
|
||||
logger.warn('初始化', `未找到 properties.json: ${resourcesPath}`);
|
||||
}
|
||||
}
|
||||
|
||||
logger.info('初始化', `Camoufox 安装成功: ${camoufoxDir}`);
|
||||
|
||||
// 更新 config.yaml
|
||||
|
||||
Reference in New Issue
Block a user