作者 朱兆平

增加用户重置密码

@@ -40,8 +40,9 @@ @@ -40,8 +40,9 @@
40 </el-table-column> 40 </el-table-column>
41 <el-table-column label="操作" width="250"> 41 <el-table-column label="操作" width="250">
42 <template slot-scope="scope"> 42 <template slot-scope="scope">
43 - <el-button size="small" @click="roleEdit(scope.$index, scope.row)">角色配置</el-button> 43 + <el-button size="small" @click="roleEdit(scope.$index, scope.row)" type="primary">角色配置</el-button>
44 <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> 44 <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
  45 + <el-button size="small" @click="resetUserPass(scope.$index, scope.row)" type="warning">重置密码</el-button>
45 <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> 46 <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
46 </template> 47 </template>
47 </el-table-column> 48 </el-table-column>
@@ -165,7 +166,7 @@ @@ -165,7 +166,7 @@
165 <script> 166 <script>
166 import util from '../../common/js/util' 167 import util from '../../common/js/util'
167 import NProgress from 'nprogress' 168 import NProgress from 'nprogress'
168 - import { getUserList, removeUser, batchRemoveUser, editUser, addUser, setUserRole } from '../../api/user'; 169 + import {getUserList, removeUser, batchRemoveUser, editUser, addUser, setUserRole, editPass} from '../../api/user';
169 import { getList} from '../../api/role_api'; 170 import { getList} from '../../api/role_api';
170 import { getList as getRoleList} from '../../api/role_api'; 171 import { getList as getRoleList} from '../../api/role_api';
171 import moment from 'moment' 172 import moment from 'moment'
@@ -328,6 +329,30 @@ @@ -328,6 +329,30 @@
328 this.editFormVisible = true; 329 this.editFormVisible = true;
329 this.editForm = Object.assign({}, row); 330 this.editForm = Object.assign({}, row);
330 }, 331 },
  332 + /**
  333 + * 重置用户密码
  334 + * @param index
  335 + * @param row
  336 + */
  337 + resetUserPass: function(index,row){
  338 + this.editForm = Object.assign({}, row);
  339 + this.editForm.password= 'zzairport@kako2020';
  340 + editPass(this.editForm).then(res=>{
  341 + let response=res.data;
  342 + if(response.code=='200'){
  343 + this.$notify({
  344 + title: '密码修改成功',
  345 + message: '密码修改成功,退出请重新登录',
  346 + type: 'success'
  347 + });
  348 + }else{
  349 + this.$notify.error({
  350 + title: '密码修改失败',
  351 + message: '密码修改失败!!!'
  352 + });
  353 + }
  354 + });
  355 + },
331 roleEdit: function (index, row) { 356 roleEdit: function (index, row) {
332 this.roleFormVisible = true; 357 this.roleFormVisible = true;
333 this.getRoles(); 358 this.getRoles();