瀏覽代碼

主页报告可视化不展示问题

zhuliu 1 年之前
父節點
當前提交
b748e0e08f
共有 2 個文件被更改,包括 12 次插入10 次删除
  1. 3 3
      src/views/layout/mixins/index.js
  2. 9 7
      src/views/login/index.vue

+ 3 - 3
src/views/layout/mixins/index.js

@@ -56,9 +56,9 @@ export const commonData = {
       })
     },
     //获取字典项
-    DictMessage() {
-      this.$api.getOsSystemDict([]).then(response => {
-        this.$store.commit("SET_DictMessage", response.data)
+    async DictMessage() {
+      await this.$api.getOsSystemDict([]).then(response => {
+          this.$store.commit("SET_DictMessage", response.data)
       })
     },
     //获取应用场景

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

@@ -245,20 +245,22 @@ export default {
     // 登录按钮点击
     submitForm() {
       this.btnLoading = true;
-      this.$api.adminLogin(this.ruleForm).then(response => {
+      this.$api.adminLogin(this.ruleForm).then(async response => {
         Storage.setStr('username', this.ruleForm.username)
         Storage.setStr('password', this.ruleForm.password)
         this.$cookie.set('token',response.data.token)
-        this.btnLoading = false
-          this.$message.success('登录成功')
-            this.$router.push({
-              path: '/home'
-            })
-            this.DictMessage()
+        sessionStorage.clear()
+        await this.DictMessage()
             this.getUserInfo()
             this.getScenario()
             this.getMatter()
             this.getPermissionList()
+            this.btnLoading = false
+          this.$message.success('登录成功')
+            this.$router.push({
+              path: '/home'
+            })
+            
       }).catch(error => {
         this.getCode()
         this.btnLoading = false