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

46 lines
1.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* 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
})
}