|
|
@@ -1,6 +1,6 @@
|
|
|
import { Modal } from 'ant-design-vue'
|
|
|
import { defineStore } from 'pinia'
|
|
|
-import { reactive } from 'vue'
|
|
|
+import { reactive, h } from 'vue'
|
|
|
|
|
|
export const useUserStore = defineStore('userStore', () => {
|
|
|
const userInfo = reactive({})
|
|
|
@@ -16,6 +16,20 @@ export const useUserStore = defineStore('userStore', () => {
|
|
|
// 设置用户信息, 校验后的登录
|
|
|
}
|
|
|
|
|
|
+ const openUserInfoModal = () => {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '您确定要退出吗?',
|
|
|
+ content: h('a-form', null, [h('a-form-item', { label: '任务名称' }, [h('a-input', null, 2233)])]),
|
|
|
+ cancelText: '取消',
|
|
|
+ okText: '确定',
|
|
|
+ onCancel: () => {},
|
|
|
+ onOk: async () => {
|
|
|
+ await clearUserInfo()
|
|
|
+ // 退出
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
const logout = () => {
|
|
|
Modal.confirm({
|
|
|
title: '您确定要退出吗?',
|
|
|
@@ -24,7 +38,7 @@ export const useUserStore = defineStore('userStore', () => {
|
|
|
onCancel: () => {},
|
|
|
onOk: async () => {
|
|
|
await clearUserInfo()
|
|
|
- // 退出
|
|
|
+ // 退出
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -33,6 +47,7 @@ export const useUserStore = defineStore('userStore', () => {
|
|
|
userInfo,
|
|
|
login,
|
|
|
logout,
|
|
|
- clearUserInfo
|
|
|
+ clearUserInfo,
|
|
|
+ openUserInfoModal
|
|
|
}
|
|
|
})
|