Commit 5d12b743 by 潘建波

添加用户锁定

1 parent 945cba1d
......@@ -22,6 +22,9 @@ export default {
delUser(params, id) {
return api.delete(`${baseUrl}/api/v1/auth/users/${id}`, params);
},
lockUser(userid, params){
return api.post(`${baseUrl}/api/v1/auth/users/${userid}`, params);
},
addRole(params) {
return api.post(`${baseUrl}/api/v1/auth/roles`, params);
},
......
......@@ -73,6 +73,18 @@
@click="delFun(scope.$index, scope.row)"
></span>
</el-tooltip>
<span class="tableSpanBorder"></span>
<el-tooltip
content="锁定"
placement="bottom"
effect="light"
:visible-arrow="false"
>
<span
:class="{'el-icon-lock editIcon':scope.row.lock,'el-icon-unlock delIcon':scope.row.lock==null||scope.row.lock}"
@click="clockuser(scope.$index, scope.row)"
></span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
......@@ -332,6 +344,39 @@ export default {
});
});
},
clockuser(index, row){
this.$confirm("此操作将锁定该用户, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
let params = {
lock:row.lock==null?true:row.lock
}
this.$api.ops.lockUser(row.user_unid, params).then(res => {
if (!res.ecode) {
this.$message({
type: "success",
message: params.lock?"锁定成功!":"解锁成功!"
});
this.getTableList();
this.$logs.oplogs(res,'serv_auth',`删除用户${row.username}`);
} else {
this.$message({
type: "error",
message: params.lock?"锁定失败!":"解锁失败!"
});
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除"
});
});
},
reset(index, row) {
this.$confirm("此操作将重置密码, 是否继续?", "提示", {
confirmButtonText: "确定",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!