service-api.js 469 Bytes
/**
 * 前端Ajax请求封装
 * @author LQ <qi.li@yoho.cn>
 * @date 2017/03/14
 */

var $ = require('yoho-jquery');

var reqUrls = {
    history: '/service/history'
};

var _ajax = function(method, reqUrl, params) {
    return  $.ajax({
        type: method || "GET",
        url: reqUrl,
        data: params
    });
};

/**
 * 历史消息
 * @param params 参数对象
 */
exports.history = function(params) {
    return  _ajax("POST", reqUrls.history, params);
};