import AjmHttp from 'ajm-framework/core/utils/ajm-http';
import AjmConfig from 'ajm-framework/core/utils/ajm-config'
// http请求对象
let $http = new AjmHttp({contextPath: AjmConfig.get("MANAGER_CONTEXT_PATH")}).getHttpClient();

//用户服务
let userService = {
  //保存或更新用户
    saveOrUpdateUser(params){
        return $http.post('/api/user/saveOrUpdate', params).then(res => res.data);
    },
	loadPermissions(params) {	
	    if (!params) {
	        params = {};
	    }else{
	        params = params;
	    }
	  return $http.post('/api/user/getUserResourceTree', params).then(resp => resp.data);
	},
    //保存用户（防越权）
    updateCurrentUserInfo(params){
        return $http.post('/api/user/updateCurrentUserInfo', params).then(res => res.data);
    },
};

export default userService;
