import Common from '../../common/Common.js';

export default {
  /**
     * 根据id查询自定义窗口
     */
  getById: function(id){
    return new Promise((resolve, reject) => {
      $.ajax({
        url: Common.getApiURL('CustomerWindowResource/get'),
        type: 'get',
        dataType: 'json',
        data: {
          id: id,
        },
        beforeSend: function(request) {
          Common.addTokenToRequest(request);
        },
        success: function(data) {
          resolve(data);
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
          reject(XMLHttpRequest);
        },
      });
    });
  },
};