Browse Source

Merge branch 'cheng' into dev

Cheng 3 years ago
parent
commit
f9b170f8c7
2 changed files with 9 additions and 9 deletions
  1. 9 0
      src/views/layout/index.vue
  2. 0 9
      src/views/login/index.vue

+ 9 - 0
src/views/layout/index.vue

@@ -118,6 +118,7 @@ export default {
   mounted() {
     this.$store.commit('SET_PREFIX', '/admin')
     this.getUserinfo()
+    this.getSelect()
   },
   methods: {
     handleSelect(index, path) {
@@ -131,6 +132,14 @@ export default {
         this.$store.commit('SET_ADMIN_USERINFO', response.data)
       })
     },
+    // 获取类型字典项
+    getSelect() {
+      this.$api.getDict().then(response => {
+        localStorage.setItem('IS_ENABLE', response.data.IS_ENABLE)
+        localStorage.setItem('SEX', response.data.SEX)
+        localStorage.setItem('TENANT_TYPE', JSON.stringify(response.data.TENANT_TYPE))
+      })
+    },
   }
 }
 </script>

+ 0 - 9
src/views/login/index.vue

@@ -188,14 +188,6 @@ export default {
         this.captcha = response.data.captcha
       })
     },
-    // 获取
-    getSelect() {
-      this.$api.getDict().then(response => {
-        localStorage.setItem('IS_ENABLE', response.data.IS_ENABLE)
-        localStorage.setItem('SEX', response.data.SEX)
-        localStorage.setItem('TENANT_TYPE', JSON.stringify(response.data.TENANT_TYPE))
-      })
-    },
     // 登录按钮点击
     submitForm() {
       this.btnLoading = true;
@@ -207,7 +199,6 @@ export default {
             this.$router.push({
               path: '/admin'
             })
-            this.getSelect()
       }).catch(error => {
         this.getCode()
         this.btnLoading = false