From 3f6f960ffcfbf5bfb3ec8ca167028e36a6881df4 Mon Sep 17 00:00:00 2001 From: hfshfg <38004547@qq.com> Date: Wed, 1 Apr 2026 09:31:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20bat=20=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E4=B9=B1=E7=A0=81=E3=80=81Config.html=20=E6=89=93?= =?UTF-8?q?=E4=B8=8D=E5=BC=80=E3=80=81missing=20scope=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix(bat): 所有 Windows .bat 文件加 UTF-8 BOM,修复中文乱码 (portable 和 usb-release 共 7 个文件,close #3) - fix(usb-release/Windows-Start.bat): 首次启动打开 Config.html 时补加 file:/// 前缀,修复浏览器无法打开本地文件的问题 (close #12) - fix(Config.html): gateway.auth 加入 scopes: ['operator.admin'], 修复配置模型时报 missing scope: operator.admin 错误 (portable / usb-release / u-claw-app 三个版本同步,close #11) Co-Authored-By: Claude Sonnet 4.6 --- portable/Config.html | 2 +- portable/Windows-Diagnose.bat | 2 +- portable/Windows-Install.bat | 2 +- portable/Windows-Menu.bat | 2 +- portable/Windows-Start.bat | 2 +- portable/setup.bat | 2 +- u-claw-app/resources/Config.html | 2 +- usb-release/Config.html | 2 +- usb-release/Windows-Menu.bat | 2 +- usb-release/Windows-Start.bat | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/portable/Config.html b/portable/Config.html index b52afa4..3619b80 100644 --- a/portable/Config.html +++ b/portable/Config.html @@ -428,7 +428,7 @@ function togglePw() { function buildOpenClawConfig(provider, base, model, apiKey) { // Base config that OpenClaw expects const baseConfig = { - gateway: { auth: { mode: 'token', token: 'uclaw' } }, + gateway: { auth: { mode: 'token', token: 'uclaw', scopes: ['operator.admin'] } }, commands: { native: 'auto', nativeSkills: 'auto', restart: true, ownerDisplay: 'raw' }, meta: { lastTouchedVersion: '2026.3.13', lastTouchedAt: new Date().toISOString() } }; diff --git a/portable/Windows-Diagnose.bat b/portable/Windows-Diagnose.bat index d98fb2f..04485fe 100644 --- a/portable/Windows-Diagnose.bat +++ b/portable/Windows-Diagnose.bat @@ -1,4 +1,4 @@ -@echo off +@echo off setlocal EnableDelayedExpansion chcp 65001 >nul 2>&1 title U-Claw - Diagnostic Tool diff --git a/portable/Windows-Install.bat b/portable/Windows-Install.bat index 772b58f..07c994a 100644 --- a/portable/Windows-Install.bat +++ b/portable/Windows-Install.bat @@ -1,4 +1,4 @@ -@echo off +@echo off setlocal EnableDelayedExpansion chcp 65001 >nul 2>&1 title U-Claw - Install to Windows diff --git a/portable/Windows-Menu.bat b/portable/Windows-Menu.bat index 2ea3b82..1c79b0b 100644 --- a/portable/Windows-Menu.bat +++ b/portable/Windows-Menu.bat @@ -1,4 +1,4 @@ -@echo off +@echo off setlocal EnableDelayedExpansion chcp 65001 >nul 2>&1 title U-Claw Menu diff --git a/portable/Windows-Start.bat b/portable/Windows-Start.bat index 717e5ff..0cc5ffd 100644 --- a/portable/Windows-Start.bat +++ b/portable/Windows-Start.bat @@ -1,4 +1,4 @@ -@echo off +@echo off chcp 65001 >nul 2>&1 title U-Claw - Portable AI Agent diff --git a/portable/setup.bat b/portable/setup.bat index fa0d4c5..f417db3 100644 --- a/portable/setup.bat +++ b/portable/setup.bat @@ -1,4 +1,4 @@ -@echo off +@echo off setlocal EnableDelayedExpansion chcp 65001 >nul 2>&1 title U-Claw Portable Setup diff --git a/u-claw-app/resources/Config.html b/u-claw-app/resources/Config.html index b52afa4..3619b80 100644 --- a/u-claw-app/resources/Config.html +++ b/u-claw-app/resources/Config.html @@ -428,7 +428,7 @@ function togglePw() { function buildOpenClawConfig(provider, base, model, apiKey) { // Base config that OpenClaw expects const baseConfig = { - gateway: { auth: { mode: 'token', token: 'uclaw' } }, + gateway: { auth: { mode: 'token', token: 'uclaw', scopes: ['operator.admin'] } }, commands: { native: 'auto', nativeSkills: 'auto', restart: true, ownerDisplay: 'raw' }, meta: { lastTouchedVersion: '2026.3.13', lastTouchedAt: new Date().toISOString() } }; diff --git a/usb-release/Config.html b/usb-release/Config.html index b52afa4..3619b80 100644 --- a/usb-release/Config.html +++ b/usb-release/Config.html @@ -428,7 +428,7 @@ function togglePw() { function buildOpenClawConfig(provider, base, model, apiKey) { // Base config that OpenClaw expects const baseConfig = { - gateway: { auth: { mode: 'token', token: 'uclaw' } }, + gateway: { auth: { mode: 'token', token: 'uclaw', scopes: ['operator.admin'] } }, commands: { native: 'auto', nativeSkills: 'auto', restart: true, ownerDisplay: 'raw' }, meta: { lastTouchedVersion: '2026.3.13', lastTouchedAt: new Date().toISOString() } }; diff --git a/usb-release/Windows-Menu.bat b/usb-release/Windows-Menu.bat index 83d1ee0..c573969 100644 --- a/usb-release/Windows-Menu.bat +++ b/usb-release/Windows-Menu.bat @@ -1,4 +1,4 @@ -@echo off +@echo off setlocal EnableDelayedExpansion chcp 65001 >nul 2>&1 title U-Claw Menu diff --git a/usb-release/Windows-Start.bat b/usb-release/Windows-Start.bat index bfe238a..5dd56d2 100644 --- a/usb-release/Windows-Start.bat +++ b/usb-release/Windows-Start.bat @@ -1,4 +1,4 @@ -@echo off +@echo off setlocal EnableDelayedExpansion chcp 65001 >nul 2>&1 title U-Claw - Portable AI Agent @@ -103,7 +103,7 @@ if "!HAS_MODEL!"=="yes" ( start /B "" cmd /c "timeout /t 3 /nobreak >nul && start http://127.0.0.1:!PORT!/#token=!TOKEN!" ) else ( echo First time setup - opening Config page in 3 seconds... - start /B "" cmd /c "timeout /t 3 /nobreak >nul && start %UCLAW_DIR%Config.html?port=!PORT!" + start /B "" cmd /c "timeout /t 3 /nobreak >nul && start file:///%UCLAW_DIR%Config.html?port=!PORT!" ) REM Start gateway (foreground, blocks until stopped)