From 7c906b4acf785180132f91db5d70c3a29fa85cd3 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期三, 21 六月 2023 09:39:13 +0800
Subject: [PATCH] 新增页面和配置,对接口

---
 src/views/Home.vue |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/views/Home.vue b/src/views/Home.vue
index abcedf0..e62029e 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -57,7 +57,7 @@
 		name: "Home",
 		data() {
 			return {
-        userInfo: {},
+        userInfo: getUserInfo(),
 				collapsed: false, //返回logo图片或表述
 				pageList: [],
 				activePage: '',
@@ -70,8 +70,6 @@
       pwdMod
 		},
 		created() {
-      this.userInfo = getUserInfo()
-      // this.getDistrictInfo()
 			const route = this.$route
 			if (this.pageList.findIndex(item => item.path === route.path) === -1) {
 				this.pageList.push(this.createPage(route))
@@ -122,16 +120,17 @@
           cancelText: '取消',
           okText: '确认',
           centered: true,
-          async onOk() {
-            const res = await loginOut()
-            if (res.data.code === 100) {
-              Session.clear(); // 清除缓存/token等
-              // 使用 reload 时,不需要调用 resetRoute() 重置路由
-              t.$router.push('/')
-              // window.location.reload();
-            } else {
-              this.$message.warning(res.data.msg);
-            }
+          onOk() {
+            loginOut().then(res=>{
+              if (res.data.code === 100) {
+                Session.clear(); // 清除缓存/token等
+                // 使用 reload 时,不需要调用 resetRoute() 重置路由
+                t.$router.push('/')
+                // window.location.reload();
+              } else {
+                this.$message.warning(res.data.msg);
+              }
+            })
           },
           onCancel() {
             console.log('Cancel');

--
Gitblit v1.9.2