fix: 解决部署问题

This commit is contained in:
2025-02-24 20:27:39 +08:00
parent 1e9f209803
commit 61bf2cc73b
13 changed files with 53 additions and 84 deletions

View File

@@ -103,23 +103,24 @@ app
}
console.log('path', path);
const check = await appPathCheck({ key });
let appType: string;
if (check) {
if (!force) {
ctx.throw(400, 'App already exists, please remove it first');
} else {
const app = manager.getAppShowInfo(key);
const appType = app?.type;
appType = app?.type;
await manager.removeApp(key);
if (appType === 'system-app') {
// 如果是system-app(主进程运行),就重载
selfRestart();
}
}
}
const installAppData = await installApp({ path, key });
await manager.add(installAppData.showAppInfo);
ctx.body = installAppData;
if (appType === 'system-app') {
// 如果是system-app(主进程运行),就重启服务
setTimeout(() => selfRestart(), 3000);
}
})
.addTo(app);

View File

@@ -48,7 +48,7 @@ app
const token = await user.createToken(null, loginType);
ctx.res.cookie('token', token.token, {
maxAge: token.expireTime,
domain: { domain },
domain,
sameSite: 'lax',
httpOnly: true,
});