Skip to content

Commit

Permalink
feat(components): 新 setting 退出登录提示
Browse files Browse the repository at this point in the history
  • Loading branch information
zane0904 committed Oct 8, 2022
1 parent 68da0e5 commit fc93b92
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions src/layouts/default/components/right/src/page/openDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,30 @@ export default defineComponent({
type="error"
class={'mb-10px'}
onClick={async () => {
store.$reset()
try {
await useLogOut()
const { openSettingDrawer } = storeToRefs(configStore())
openSettingDrawer.value = false
} catch (error) {
logError(error as Error)
}
const example = createModal({
title: '温馨提示',
type: 'warning',
content: '是否清除当前所有配置并退出系统?',
positiveText: '确定',
negativeText: '取消',
maskClosable: false,
onPositiveClick: async () => {
return new Promise(async (resolve) => {
example.loading = true
store.$reset()
try {
await useLogOut()
const { openSettingDrawer } = storeToRefs(
configStore(),
)
resolve(true)
openSettingDrawer.value = false
} catch (error) {
logError(error as Error)
}
})
},
})
}}
>
清空并返回登录页
Expand Down

0 comments on commit fc93b92

Please sign in to comment.