作者 朱兆平

增加用户重置密码

... ... @@ -40,8 +40,9 @@
</el-table-column>
<el-table-column label="操作" width="250">
<template slot-scope="scope">
<el-button size="small" @click="roleEdit(scope.$index, scope.row)">角色配置</el-button>
<el-button size="small" @click="roleEdit(scope.$index, scope.row)" type="primary">角色配置</el-button>
<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button size="small" @click="resetUserPass(scope.$index, scope.row)" type="warning">重置密码</el-button>
<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
... ... @@ -165,7 +166,7 @@
<script>
import util from '../../common/js/util'
import NProgress from 'nprogress'
import { getUserList, removeUser, batchRemoveUser, editUser, addUser, setUserRole } from '../../api/user';
import {getUserList, removeUser, batchRemoveUser, editUser, addUser, setUserRole, editPass} from '../../api/user';
import { getList} from '../../api/role_api';
import { getList as getRoleList} from '../../api/role_api';
import moment from 'moment'
... ... @@ -328,6 +329,30 @@
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
/**
* 重置用户密码
* @param index
* @param row
*/
resetUserPass: function(index,row){
this.editForm = Object.assign({}, row);
this.editForm.password= 'zzairport@kako2020';
editPass(this.editForm).then(res=>{
let response=res.data;
if(response.code=='200'){
this.$notify({
title: '密码修改成功',
message: '密码修改成功,退出请重新登录',
type: 'success'
});
}else{
this.$notify.error({
title: '密码修改失败',
message: '密码修改失败!!!'
});
}
});
},
roleEdit: function (index, row) {
this.roleFormVisible = true;
this.getRoles();
... ...