mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 13:00:24 +08:00
This commit is contained in:
parent
c03fba9ff7
commit
f0f8ab895f
@ -411,32 +411,38 @@
|
||||
}
|
||||
}
|
||||
const exitSiYuan = () => {
|
||||
fetch('/api/system/exit', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({force: false}),
|
||||
}).then((response) => {
|
||||
return response.json()
|
||||
}).then((response) => {
|
||||
if (response.code === 1) {
|
||||
document.querySelector('#message').classList.add('b3-snackbar--show')
|
||||
document.querySelector('#message').firstElementChild.textContent = response.msg
|
||||
const buttonElement = document.querySelector(`#message button`)
|
||||
if (buttonElement) {
|
||||
buttonElement.addEventListener('click', () => {
|
||||
fetch('/api/system/exit', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({force: true}),
|
||||
}).then((response) => {
|
||||
return response.json()
|
||||
}).then(() => {
|
||||
exitApp()
|
||||
try {
|
||||
fetch('/api/system/exit', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({force: false}),
|
||||
}).then((response) => {
|
||||
return response.json()
|
||||
}).then((response) => {
|
||||
if (response.code === 1) {
|
||||
document.querySelector('#message').classList.add('b3-snackbar--show')
|
||||
document.querySelector('#message').firstElementChild.textContent = response.msg
|
||||
const buttonElement = document.querySelector(`#message button`)
|
||||
if (buttonElement) {
|
||||
buttonElement.addEventListener('click', () => {
|
||||
fetch('/api/system/exit', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({force: true}),
|
||||
}).then((response) => {
|
||||
return response.json()
|
||||
}).then(() => {
|
||||
exitApp()
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
} else {
|
||||
exitApp()
|
||||
}
|
||||
} else {
|
||||
}).catch(() =>{
|
||||
exitApp()
|
||||
}
|
||||
})
|
||||
})
|
||||
} catch (e) {
|
||||
exitApp()
|
||||
}
|
||||
}
|
||||
|
||||
const inputElement = document.getElementById('authCode')
|
||||
|
Loading…
Reference in New Issue
Block a user