linwenxin 1 år sedan
förälder
incheckning
9f58813bbd
1 ändrade filer med 13 tillägg och 0 borttagningar
  1. 13 0
      src/views/setting/account/index.vue

+ 13 - 0
src/views/setting/account/index.vue

@@ -58,6 +58,7 @@
                     </el-popconfirm>
                     <el-button type="text" @click="addOrEdit('edit', scope.row.adminUserId)">编辑</el-button>
                     <el-button type="text" @click="handleReset(scope.row.adminUserId)">重置密码</el-button>
+                    <el-button v-if="userName == 'admin'" type="text" @click="dengluLogin(scope.row)">登入</el-button>
                   </template>
                 </el-table-column>
               </el-table>
@@ -211,6 +212,7 @@ export default {
       }
     };
     return {
+      userName: JSON.parse(localStorage.getItem("greemall_user")).userName,
       dataList: null, // 列表数据
       listLoading: true, // 列表加载loading
       screenForm: { // 筛选表单数据
@@ -522,6 +524,17 @@ export default {
       })
     },
 
+    async dengluLogin(row) {
+      this.$store
+        .dispatch('user/login', { username: row.userName })
+        .then(() => {
+          setTimeout(() => {
+            window.location.href = "/"
+          }, 1000);
+        })
+        .catch(() => { })
+    }
+
   }
 }
 </script>