import request from '../utils/request'
import {codeProjectName} from '../config'
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);
const baseUrl = window.HIVUI_SETTING.login||(__base+"/login/sso-login");

export function baseLogin(param) {
  return _request({
    url: baseUrl,
    method: 'post',
    data: param,
  })
}
export function logout(param) {
  return _request({
    url: __base+"/login/sso-logout",
    method: 'post',
    data: param,
  })
}
