import request from '../utils/request'
import {codeProjectName} from '../config'
import qs from 'qs';
let hi_request=null;
if(window.HIVUI_SETTING&&window.HIVUI_SETTING.request){
  hi_request=window.HIVUI_SETTING.request;
}
function _request(opt){
  if(hi_request){
    return hi_request(opt);
  }else{
    return request(opt);
  }
}
const __base=(window.HIVUI_SETTING.serverUrl||codeProjectName);

//获取用户信息
export function getInfo(param) {
  return _request({
    url: window.HIVUI_SETTING.userInfo||(__base+"/sys/user/detail"),
    method: 'post',
    data: param,
  })
}
//获取多岗列表
export function getBzList(param) {
  return _request({
    url: __base+"/sys/user/detail-list",
    method: 'post',
    data: param,
  })
}
//切换编制岗位
export function changeBz(param) {
  return _request({
    url: __base+"/sys/user/switch-bz",
    method: 'post',
    data: param,
  })
}
//修改密码
export function modifyPassword(param) {
  return _request({
    url: __base+"/sys/user/update-pwd",
    method: 'post',
    data: param,
  })
}