fix: 修复 Windows start.ps1 闪退,保持终端不关闭便于 Debug
Test start.ps1 (Windows) / test-windows (push) Waiting to run

- 增加 trap 错误捕获与堆栈输出
- 增加 Wait-ForExit 结束时暂停,避免窗口闪退
- 使用 $PSScriptRoot 获取脚本目录
- README 补充 Windows 权限配置与启动说明

Made-with: Cursor
This commit is contained in:
2026-03-10 22:13:12 +08:00
parent b7a11abe9f
commit fe370bd5bc
2 changed files with 64 additions and 5 deletions
+38
View File
@@ -247,6 +247,44 @@ chmod +x start.sh
```
6. 脚本运行完成无错误,并且提示`EasyAI应用启动成功`表示应用启动成功,打开浏览器输入服务器的公网ip:3010或者局域网IP:3010,即可访问EasyAI应用
## Windows 一键启动
start.ps1 脚本用于 Windows 本机/局域网一键部署 EasyAI 应用。**不要直接双击运行**(会闪退),请按以下方式执行:
### 权限配置(首次执行必做)
PowerShell 默认可能禁止运行脚本,需先执行以下任一方式:
**方式一:临时允许本次运行(推荐)**
```powershell
powershell -ExecutionPolicy Bypass -File .\start.ps1
```
**方式二:为当前用户永久放开脚本执行权限**
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
执行后再运行 `.\start.ps1` 即可。
### 启动步骤
1. 克隆并进入目录
```powershell
git clone https://git.51easyai.com/wangbo/easyai.git
cd easyai
```
2. 在 PowerShell 或 CMD 中运行(二选一)
```powershell
# 若已设置 ExecutionPolicy,可直接执行
.\start.ps1
# 未设置时使用 Bypass 方式
powershell -ExecutionPolicy Bypass -File .\start.ps1
```
3. 按提示选择 [1] 本地访问 或 [2] 局域网访问,脚本将自动配置并启动 Docker 服务。
### 启用HTTPS
1. [更改为你的域名]修改`easyai-proxy.conf`中域名`51easyai.com`为你的域名[可以使用Ctrl+F批量替换51easyai.com为你的域名]
2. [修改.env文件]修改如下两个环境变量为如下的对应的值