Merge pull request '退出' (#81) from lyc-dev into main
This commit is contained in:
commit
d6c302fc04
|
@ -9,6 +9,10 @@
|
|||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
|
||||
const props = defineProps({
|
||||
|
@ -30,7 +34,18 @@ const maximizeWindow = () => {
|
|||
}
|
||||
//关闭
|
||||
const closeWindow = () => {
|
||||
ipcRenderer?.send('close-window')
|
||||
ElMessageBox.confirm('确认退出系统吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
userStore.logOut().then(() => {
|
||||
ipcRenderer && ipcRenderer.send('close-window')
|
||||
}).catch(()=>{
|
||||
|
||||
ipcRenderer && ipcRenderer.send('close-window')
|
||||
})
|
||||
}).catch(() => { });
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ function handleCommand(command) {
|
|||
}
|
||||
|
||||
function logout() {
|
||||
ElMessageBox.confirm('确认退出系统', '提示', {
|
||||
ElMessageBox.confirm('确认退出系统吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
|
|
Loading…
Reference in New Issue