cmc-web/packages/api/system/account.js

46 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-08-20 12:11:31 +00:00
/**
* Created by HaijunZhang on 2019/7/23.
*/
import { request } from '@cmp/cmp-element'
import { wrapperParams } from 'utils'
const baseUrl = '/sms/v1/accounts'
export function getAccount(params) {
return request.get(`${baseUrl}/page`, {
params
})
}
export function getUserDetail(id) {
return request.get(`${baseUrl}/${id}`)
}
export function createUser(params) {
return request.post(baseUrl, wrapperParams(params))
}
export function modifyUser(params) {
return request.put(`${baseUrl}/${params.id}`, wrapperParams(params))
}
export function removeUser(id) {
return request.delete(`${baseUrl}/${id}`)
}
/*
* action取值为
* lock active reset accredit change
*/
export function operateUser(id, action, params) {
return request.patch(`${baseUrl}/${id}`, {
action,
...wrapperParams(params)
})
}
export function checkUser(id) {
return request.get(`${baseUrl}/${id}/status`)
}
export function getRolesByUser(id) {
return request.get(`${baseUrl}/${id}/roles`)
}
export function getTrack(params) {
return request.get(`${baseUrl}/track`, {
params: params
})
}