修改重置密码,编辑,改变状态接口

This commit is contained in:
red-deng-deng 2021-11-22 14:14:46 +08:00
parent a2d63b4871
commit 93d0a61518
4 changed files with 10 additions and 12 deletions

View File

@ -235,16 +235,16 @@ export const getAccountList = (params) => {
return req('get', baseurl + "/auth/admin", params) return req('get', baseurl + "/auth/admin", params)
} }
//修改账号状态 //修改账号状态
export const putAccountStatus = (params) => { export const putAccountStatus = (id,params) => {
return req('put', baseurl + "/auth/admin/status",params) return req('put', baseurl + "/auth/admin/status/"+id,params)
} }
// 删除账号 // 删除账号
export const delAccount = (id) => { export const delAccount = (id) => {
return req('delete', baseurl + "/auth/admin/"+id) return req('delete', baseurl + "/auth/admin/"+id)
} }
// 重置账号密码 // 重置账号密码
export const putModifypwd = (data) => { export const putModifypwd = (id,data) => {
return req('put', baseurl + "/auth/admin/password",data) return req('put', baseurl + "/auth/admin/password/"+id,data)
} }
//添加账号-获取部门 //添加账号-获取部门
export const getDepartment = (params) => { export const getDepartment = (params) => {
@ -263,8 +263,8 @@ export const postAddAcc = (params) => {
return req('post', baseurl + "/auth/admin",params) return req('post', baseurl + "/auth/admin",params)
} }
//添加账号-编辑账号 //添加账号-编辑账号
export const putAddAcc = (params) => { export const putAddAcc = (id,params) => {
return req('put', baseurl + "/auth/admin",params) return req('put', baseurl + "/auth/admin/"+id,params)
} }

View File

@ -101,10 +101,10 @@ export default class adduserinfo extends React.Component{
}).catch(err=>{ }).catch(err=>{
}); });
}else{//编辑 }else{//编辑
data.id=_this.state.id; let id=_this.state.id;
delete data.password; delete data.password;
data.head=_this.state.headImg; data.head=_this.state.headImg;
putAddAcc(data).then(res=>{ putAddAcc(id,data).then(res=>{
handelResponse(res,(response,msg)=>{ handelResponse(res,(response,msg)=>{
Notify.clear(); Notify.clear();
Notify.success(msg); Notify.success(msg);

View File

@ -113,7 +113,6 @@ export default class acclistDom extends React.Component{
onSwitchChange(status,row){ onSwitchChange(status,row){
let self = this; let self = this;
let data={ let data={
id:row.id,
status:row.status==0?1:0 status:row.status==0?1:0
} }
Sweetalert.confirm({ Sweetalert.confirm({
@ -122,7 +121,7 @@ export default class acclistDom extends React.Component{
title:'确认操作', title:'确认操作',
content: <p>是否{row.status==0?'启用':'停用'}<b>[{row.user_name}]</b></p>, content: <p>是否{row.status==0?'启用':'停用'}<b>[{row.user_name}]</b></p>,
onConfirm:()=>{ onConfirm:()=>{
putAccountStatus(data).then(res=>{ putAccountStatus(row.id,data).then(res=>{
handelResponse(res,(response,msg)=>{ handelResponse(res,(response,msg)=>{
Notify.clear(); Notify.clear();
Notify.success(msg); Notify.success(msg);

View File

@ -28,8 +28,7 @@ const Modifypwd=(props)=>{
console.log(value); console.log(value);
if(value){ if(value){
let data=_.cloneDeep(value); let data=_.cloneDeep(value);
data.id=props.id; putModifypwd(props.id,data).then(res=>{
putModifypwd(data).then(res=>{
handelResponse(res,(response,msg)=>{ handelResponse(res,(response,msg)=>{
Notify.clear(); Notify.clear();
Notify.success(msg); Notify.success(msg);