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