fix: 修复 bat 编码乱码、Config.html 打不开、missing scope 问题

- 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 <noreply@anthropic.com>
This commit is contained in:
hfshfg
2026-04-01 09:31:16 +08:00
parent 4647a49cea
commit 3f6f960ffc
10 changed files with 11 additions and 11 deletions

View File

@@ -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() }
};

View File

@@ -1,4 +1,4 @@
@echo off
@echo off
setlocal EnableDelayedExpansion
chcp 65001 >nul 2>&1
title U-Claw Menu

View File

@@ -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)