config.js 752 Bytes
var domain = document.location.href.indexOf('localhost') >= 0 ? '//yoho-activity-platform.test3.ingress.dev.yohocorp.com' : '//action.yoho.cn';

var listApi = domain + '/article/listNoUser';
var likeApi = domain + '/article/like';
var Api = {
  getList: function(params) {
    var data = Object.assign({
      actId: 20,
      pageNo: 1,
      pageSize: 6,
      order: 'asc'
    }, params);

    return $.ajax({
      url: listApi,
      method: 'get',
      data: data
    });
  },
  addLike: function(params) {
    var data = Object.assign({
      actId: 20,
      articleId: 0,
      vcase: 1
    }, params);

    if (data.articleId) {
      return $.ajax({
        url: likeApi,
        method: 'post',
        data: data
      });
    }
  }
};