mirror of
https://github.com/halfwaystudent/douyin-sparkflow.git
synced 2026-09-05 23:49:50 +08:00
fix: support mobile login workspace
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user