refactor(server): 重构浏览器自动打开功能

- 将导入的 open 模块重命名为 openUrl 以避免命名冲突
- 更新调用 openUrl 函数来打开指定 URL
- 保持错误处理逻辑不变,确保异常情况下的日志记录
This commit is contained in:
coolxitech
2025-12-13 13:47:34 +08:00
parent 7307791314
commit 1b2718246f

View File

@@ -1,6 +1,6 @@
const express = require('express');
const path = require('node:path');
const open = require('open');
const openUrl = require('open');
const os = require('node:os');
const app = express();
@@ -37,7 +37,7 @@ const server = app.listen(0, HOST, async () => {
// 3. 自动打开浏览器
try {
await open(url);
await openUrl(url);
} catch (err) {
console.error('无法自动打开浏览器:', err);
}