更新依赖,增强ASR功能,优化代理路由处理,添加登录页面渲染

This commit is contained in:
2026-01-15 12:42:37 +08:00
parent 2011ea818c
commit a5ce44ba70
9 changed files with 188 additions and 82 deletions

View File

@@ -0,0 +1,52 @@
export const renderNoAuthAndLogin = (text: string) => {
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Required</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
background: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
text-align: center;
}
h1 {
color: #333;
}
p {
color: #666;
}
a {
display: inline-block;
margin-top: 15px;
padding: 10px 15px;
background-color: #007BFF;
color: white;
text-decoration: none;
border-radius: 5px;
}
a:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<p>${text}</p>
<a href="/root/home">转到首页</a>
</div>
</body>
</html>`;
}

View File

@@ -453,7 +453,6 @@ export const LoadApp = async (app: AppInfo, opts?: { mainApp?: any, pm2Connect?:
console.log('gateway app not support');
} else if (app.type === AppType.Pm2SystemApp) {
const pathEntry = path.join(app.path, app.entry);
console.log('pm2 system app start', pathEntry);
const pm2Manager = new Pm2Manager({
appName: app.key,
script: pathEntry,
@@ -473,7 +472,6 @@ export const LoadApp = async (app: AppInfo, opts?: { mainApp?: any, pm2Connect?:
if (!pm2Options.cwd) {
pm2Options.cwd = path.join(app.path, '../..');
}
console.log('pm2 start options', pm2Options);
await pm2Manager.start(pm2Options);
} else if (app.type === AppType.ScriptApp) {
// console.log('script app 直接运行,不需要启动');