fix: 修复 importSessions 中 result 变量重复声明导致编译失败

This commit is contained in:
thzxx
2026-04-07 02:10:01 +08:00
parent 0a476365b2
commit 4dcbb4f1e9
3 changed files with 33 additions and 5 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
set -e
PROJECT="/root/.openclaw/workspace/metona-ollama"
cd "$PROJECT"
echo "===== [1/6] 安装 Wine ====="
dpkg --add-architecture i386
apt-get update -qq 2>/dev/null || sed -i 's|http://mirrors.cloud.aliyuncs.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list && apt-get update -qq
apt-get install -y -qq wine wine32 2>&1 | tail -3
echo "Wine 安装完成: $(wine --version 2>/dev/null || echo 'installed')"
echo ""
echo "===== [2/6] 安装 npm 依赖 ====="
cd "$PROJECT"
npm config set registry https://registry.npmmirror.com
npm install 2>&1 | tail -5
echo "npm install 完成"
echo ""
echo "===== [3/6] 构建 Windows 安装包 ====="
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ npm run dist 2>&1 | tail -20
echo ""
echo "构建产物:"
ls -lh "$PROJECT/release/"*.exe 2>/dev/null || echo "未找到 exe 文件"
echo ""
echo "===== BUILD SCRIPT DONE ====="
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "metona-ollama-desktop", "name": "metona-ollama-desktop",
"version": "3.0.0", "version": "3.1.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "metona-ollama-desktop", "name": "metona-ollama-desktop",
"version": "3.0.0", "version": "3.1.0",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@types/node": "^20.17.0", "@types/node": "^20.17.0",
+3 -3
View File
@@ -271,9 +271,9 @@ async function importSessions(filePath: string): Promise<void> {
return; return;
} }
const result = await db.importSessions(sessions); const importResult = await db.importSessions(sessions);
showToast(`导入完成:${result.imported} 个会话${result.skipped > 0 ? `,跳过 ${result.skipped}` : ''}`, 'success', 4000); showToast(`导入完成:${importResult.imported} 个会话${importResult.skipped > 0 ? `,跳过 ${importResult.skipped}` : ''}`, 'success', 4000);
logSuccess(`导入完成: ${result.imported} 个, 跳过 ${result.skipped}`); logSuccess(`导入完成: ${importResult.imported} 个, 跳过 ${importResult.skipped}`);
} catch (err) { } catch (err) {
showToast(`导入失败: ${(err as Error).message}`, 'error'); showToast(`导入失败: ${(err as Error).message}`, 'error');
logError('导入失败', (err as Error).message); logError('导入失败', (err as Error).message);