UserLogAPI.js 1.76 KB
Newer Older
YazhouChen's avatar
YazhouChen committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
import Axios from 'axios'
import {
  REQUEST_CONFIG, USER_LOGIN_LOG_SPLIT, USER_LOGIN_LOG_COUNT, USER_LOGIN_LOG_DOWNLOAD,
  USER_OPTION_LOG_SPLIT, USER_OPTION_LOG_COUNT, USER_OPTION_LOGDOWNLOAD
} from "../../utils/RequestUrls";

var staticMethods = {
  // 条件分页查询登录日志
  putQueryLoginLogSplitByCondition: function (beginItem, endItem, selectList) {
    return Axios.put(USER_LOGIN_LOG_SPLIT+beginItem+"/"+endItem,selectList,REQUEST_CONFIG);
  },

  //条件分页查询操作日志
  putQueryOptionLogSplitByCondition: function (beginItem, endItem, selectList) {
    return Axios.put(USER_OPTION_LOG_SPLIT+beginItem+"/"+endItem,selectList,REQUEST_CONFIG);
  },

  // 添加查询登录日志总条数
  putQueryLoginLogCountsByCondition: function (selectList) {
    return Axios.put(USER_LOGIN_LOG_COUNT, selectList, REQUEST_CONFIG);
  },

  //添加查询操作日志总条数
  putQueryOLogCountsByCondition: function (selectList) {
    return Axios.put(USER_OPTION_LOG_COUNT, selectList, REQUEST_CONFIG);
  },

  // 导出用户登录日志
  putExportLoginLogToExcel: function (selectList) {
    return Axios.put(USER_LOGIN_LOG_DOWNLOAD, selectList, {
      headers: {
        'Content-Type': 'application/json'
      },
      responseType: 'arraybuffer'
    });
  },

  //导出用户操作日志
  putExportOptionLogToExcel: function (selectList) {
    return Axios.put(USER_OPTION_LOGDOWNLOAD, selectList, {
      headers: {
        'Content-Type': 'application/json'
      },
      responseType: 'arraybuffer'
    });
  }
};

function UserLogAPI (websocketService = null) {

  return Object.freeze(Object.assign(
    {
      // object methods comes here
    },
    staticMethods
  ))
}
// inject static methods
Object.assign(UserLogAPI, staticMethods);
export default UserLogAPI