lvkun преди 2 години
родител
ревизия
e2bae3a502
променени са 3 файла, в които са добавени 22 реда и са изтрити 7 реда
  1. 3 3
      README.md
  2. 1 1
      src/layout/user.vue
  3. 18 3
      src/store/modules/user/index.ts

+ 3 - 3
README.md

@@ -70,6 +70,6 @@ npm run build:package  该指令全是将目前已有的模块分别打包
 
 1. 支持对浏览器标签的信息设置
 2. 打包mac程序
- 	3.   用户模块
- 	4.   菜单在移动端下的设置
- 	5.   区域纯净模式
+3. 用户模块
+4. 菜单在移动端下的设置
+5. 区域纯净模式

+ 1 - 1
src/layout/user.vue

@@ -10,7 +10,7 @@
     <template #overlay>
       <a-menu>
         <a-menu-item>
-          <a href="javascript:;">个人信息</a>
+          <a href="javascript:;"  @click="userStore.openUserInfoModal()">个人信息</a>
         </a-menu-item>
         <a-menu-item>
           <a href="javascript:;" @click="userStore.logout()">退出登录</a>

+ 18 - 3
src/store/modules/user/index.ts

@@ -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
   }
 })