fix: support mobile login workspace

This commit is contained in:
Rixuan Shao
2026-07-11 21:05:59 +08:00
parent 32d58940ff
commit 472b3e8304
12 changed files with 208 additions and 18 deletions
+15
View File
@@ -1610,6 +1610,21 @@ textarea {
flex-direction: column;
}
.login-actions .button-row {
display: grid;
grid-template-columns: 1fr;
}
.login-actions .button-row .button {
width: 100%;
justify-content: center;
}
.desktop-frame {
aspect-ratio: auto;
min-height: 68vh;
}
.overview-strip,
.metric-grid {
grid-template-columns: 1fr;
+12 -3
View File
@@ -409,13 +409,22 @@
document.querySelectorAll(".login-desktop-open").forEach((button) => {
button.addEventListener("click", async () => {
// Mobile browsers block window.open after an awaited request. Open the
// authenticated same-origin workspace while the click gesture is active.
const popup = publicUrl
? window.open(publicUrl, "_blank", "noopener")
: null;
try {
await postForm("/login-desktop/open");
loadFrame();
window.open(publicUrl, "_blank", "noopener");
setStatus("请在登录工作区完成登录,然后保存登录态。");
if (!popup && frame) {
frame.scrollIntoView({ behavior: "smooth", block: "start" });
setStatus("???????????????????????");
} else {
setStatus("????????????????????????");
}
} catch (error) {
setStatus(`打开登录工作区失败:${error.message}`, "danger");
setStatus(`??????????${error.message}`, "danger");
}
});
});