wangJJ 5 éve
szülő
commit
4e1badf9ca
2 módosított fájl, 34 hozzáadás és 28 törlés
  1. 15 14
      src/components/commons/Header.vue
  2. 19 14
      src/components/commons/Header2.0.vue

+ 15 - 14
src/components/commons/Header.vue

@@ -403,20 +403,20 @@ export default {
           'isAgency': false,
           'isSystemAdministrator': false
         })
-        console.log('本地没有用户信息,开始加载用户信息')
-        getCurrentUser().then((res) => {
-          console.log(res)
-          storageSave('user', res)
-          this.user = res
-          this.rolesPermissions = getRolesPermissions(res.roleList)
-          storageSave('rolesPermissions', getRolesPermissions(res.roleList))
-          console.log('用户信息加载成功')
-          this.isLogin = true
-          this.fullScreenLoading = false
-        }).catch((error) => {
-          console.log('用户信息加载失败')
-          this.fullScreenLoading = false
-        })
+        // console.log('本地没有用户信息,开始加载用户信息')
+        // getCurrentUser().then((res) => {
+        //   console.log(res)
+        //   storageSave('user', res)
+        //   this.user = res
+        //   this.rolesPermissions = getRolesPermissions(res.roleList)
+        //   storageSave('rolesPermissions', getRolesPermissions(res.roleList))
+        //   console.log('用户信息加载成功')
+        //   this.isLogin = true
+        //   this.fullScreenLoading = false
+        // }).catch((error) => {
+        //   console.log('用户信息加载失败')
+        //   this.fullScreenLoading = false
+        // })
       } else {
         this.user = storageGet('user')
         this.fullScreenLoading = false
@@ -618,6 +618,7 @@ export default {
     // if (storageGet('user' != null)){
     //   this.isLogin = true
     // }
+    console.log('header')
     console.log(this.isLogin)
   }
 }

+ 19 - 14
src/components/commons/Header2.0.vue

@@ -140,20 +140,25 @@
                     'isAgency': false,
                     'isSystemAdministrator': false
                 });
-                console.log('本地没有用户信息,开始加载用户信息')
-                getCurrentUser().then((res) => {
-                    // console.log(res)
-                    storageSave('user', res)
-                    this.user = res
-                    this.rolesPermissions = getRolesPermissions(res.roleList)
-                    storageSave('rolesPermissions', getRolesPermissions(res.roleList))
-                    console.log('用户信息加载成功')
-                    this.isLogin = true
-                    this.fullScreenLoading = false
-                }).catch((error) => {
-                    console.log('用户信息加载失败')
-                    this.fullScreenLoading = false
-                })
+                // console.log('本地没有用户信息,开始加载用户信息')
+              this.user = storageGet('user')
+              this.rolesPermissions = getRolesPermissions(storageGet('user')&&storageGet('user').roleList)
+              storageSave('rolesPermissions', getRolesPermissions(torageGet('user')&&storageGet('user').roleList))
+              this.isLogin = true
+              this.fullScreenLoading = false
+                // getCurrentUser().then((res) => {
+                //     // console.log(res)
+                //     storageSave('user', res)
+                //     this.user = res
+                //     this.rolesPermissions = getRolesPermissions(res.roleList)
+                //     storageSave('rolesPermissions', getRolesPermissions(res.roleList))
+                //     console.log('用户信息加载成功')
+                //     this.isLogin = true
+                //     this.fullScreenLoading = false
+                // }).catch((error) => {
+                //     console.log('用户信息加载失败')
+                //     this.fullScreenLoading = false
+                // })
             } else {
                 this.user = storageGet('user')
                 this.fullScreenLoading = false