mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 Improve exit
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
d313986988
commit
c4326bd9d9
2 changed files with 13 additions and 6 deletions
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -264,6 +264,7 @@ interface Window {
|
||||||
returnDesktop(): void
|
returnDesktop(): void
|
||||||
print(title: string, html: string): void
|
print(title: string, html: string): void
|
||||||
getScreenWidthPx(): number
|
getScreenWidthPx(): number
|
||||||
|
exit(): void
|
||||||
};
|
};
|
||||||
|
|
||||||
Protyle: import("../protyle/method").default;
|
Protyle: import("../protyle/method").default;
|
||||||
|
|
|
||||||
|
|
@ -428,11 +428,17 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((window.webkit && window.webkit.messageHandlers) || window.JSHarmony) {
|
if (window.webkit && window.webkit.messageHandlers) {
|
||||||
window.location.href = 'siyuan://api/system/exit'
|
window.webkit.messageHandlers.exit.postMessage("");
|
||||||
} else {
|
return;
|
||||||
window.location.reload()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.JSHarmony) {
|
||||||
|
window.JSHarmony.exit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.location.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -472,7 +478,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const showMessage = (msg)=> {
|
const showMessage = (msg) => {
|
||||||
document.querySelector('#message').classList.add('b3-snackbar--show')
|
document.querySelector('#message').classList.add('b3-snackbar--show')
|
||||||
document.querySelector('#message').firstElementChild.innerHTML = msg
|
document.querySelector('#message').firstElementChild.innerHTML = msg
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
@ -485,7 +491,7 @@
|
||||||
const inputElement = document.getElementById('authCode')
|
const inputElement = document.getElementById('authCode')
|
||||||
const captchaElement = document.getElementById('captcha')
|
const captchaElement = document.getElementById('captcha')
|
||||||
const rememberMeElement = document.getElementById('rememberMe')
|
const rememberMeElement = document.getElementById('rememberMe')
|
||||||
let code = inputElement.value.trim();
|
let code = inputElement.value.trim();
|
||||||
if ("" === code) {
|
if ("" === code) {
|
||||||
showMessage({{.l9}})
|
showMessage({{.l9}})
|
||||||
inputElement.value = ''
|
inputElement.value = ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue