import {
    splicingParam,
    postform,
    post,
} from '../utils/request'

// 获取所有用户
const getAllUser = () => {
    return post(systemConfig.oauthServiceUrl + '/user/getAllUser');
}

// 获取单个用户的权限
const getSingleUserAuth = (params) => {
    let str = splicingParam(params)
    return post(systemConfig.oauthServiceUrl + "/permission/selectRoleAndPermis?" + str);
}

// 保存当前设置的用户的权限
const saveNowUserAuth = (params) => {
    // let str = splicingParam(params)
    return postform(systemConfig.dataUrl + "/permission/insertlayerAreaCode", params);
}

// 行政区划
const getRegionByCode = (params) => {
    let str = splicingParam(params)
    return post("/proxy_area/area/area/selectCountByCityCode?" + str);
}


export default {
    getAllUser,
    getSingleUserAuth,
    saveNowUserAuth,
    getRegionByCode
}