text: define([
      'jquery',
      'lodash',
      'WebCommon/toast/toast'
  ], function(
      $,
      _,
      Toast
  ){
      // var BaseUrl = 'http://fnji.test.com';
      var BaseUrl = 'http://oa.fnji.com/Manage';
      var ErrorEnum = {
          DataError: {
              code: 'DATA_ERROR',
              data: '数据异常'
          },
          NetworkError: {
              code: 'NETWORK_ERROR',
              data: '网络异常'
          },
          ParamError: {
              code: 'PARAM_ERROR',
              data: '参数错误'
          }
      };
      function Api(path, defaultOptions){
          this.url = BaseUrl + path;
          this.defaultOptions = defaultOptions || {};
      }
      Api.prototype.ajaxPromise = function(params, options){
          console.log(this.defaultOptions)
          var dfd = $.Deferred();
          var opts = {
              url: this.url,
              dataType: 'json'
          };
          if (params) opts.data = params;
          opts = _.assign(opts, this.defaultOptions, options);
  
          $.ajax(opts)
              .done(function(result){
                  if (!result){
                      dfd.reject(ErrorEnum.DataError);
                  } else if (result.error === 0) {
                      dfd.resolve(result.result);
                  } else {
                      dfd.reject(result);
                  }
              })
              .fail(function(){
                  dfd.reject(ErrorEnum.NetworkError);
              });
  
          return dfd.promise();
      };
      Api.prototype.ajax = function(params, options){
          Toast.showLoadingToast();
          return this.ajaxPromise(params, options)
              .fail(function(error){
                  console.log(error);
                  alert(error.data);
              })
              .always(function(){
                  Toast.hideLoadingToast();
              });
      };
  
      return {
          Api: Api,
  
          getAllDepartmentList: new Api('/OrganizationalStructure/index', {type: 'POST'}),//获取部门树
          getDepartmentList: new Api('/OrganizationalStructure/all', {type: 'POST'}),//获取部门列表
          addDepartmentApi: new Api('/OrganizationalStructure/add', {type: 'POST'}),//添加部门
          deleteDepartmentApi: new Api('/OrganizationalStructure/delete', {type: 'POST'}),//删除部门
          updateDepartmentApi: new Api('/OrganizationalStructure/update', {type: 'POST'}),//修改部门信息
          checkDepartmentApi: new Api('/OrganizationalStructure/check', {type: 'POST'}),//查看部门信息
  
          exportDepartmentApi: new Api('/OrganizationalStructure/export', {type: 'POST'}),//导出部门信息
      };
  });
  