index.js 3.69 KB
import api from "../index";
import baseUrl from "../baseUrl";
export default {
  getUserList(params, id) {
    return api.get(`${baseUrl}/api/v1/auth/users`, params);
  },
  getRoleList(params, id) {
    return api.get(`${baseUrl}/api/v1/auth/roles`, params);
  },
  addUser(params) {
    return api.post(`${baseUrl}/api/v1/auth/users`, params);
  },
  editUser(params, id) {
    return api.post(`${baseUrl}/api/v1/auth/users/${id}`, params);
  },
  resetPwd(params, id) {
    return api.post(`${baseUrl}/api/v1/auth/users/${id}/password`, params);
  },
  adminresetPwd(params, id) {
    return api.post(`${baseUrl}/api/v1/auth/users/${id}/password/reset`, params);
  },
  delUser(params, id) {
    return api.delete(`${baseUrl}/api/v1/auth/users/${id}`, params);
  },
  lockUser(userid, params){
    return api.post(`${baseUrl}/api/v1/auth/users/${userid}`, params);
  },
  addRole(params) {
    return api.post(`${baseUrl}/api/v1/auth/roles`, params);
  },
  delRole(roleid, params) {
    return api.delete(`${baseUrl}/api/v1/auth/roles/${roleid}`, params)
  },
  unbindRole(params, id, id2) {
    return api.delete(
      `${baseUrl}/api/v1/auth/users/${id}/roles/${id2}`,
      params
    );
  },
  logList(params) {
    return api.get(`${baseUrl}/api/v1/devconf_fx/logs`, params);
  },
  bindperms(params, id) {
    return api.post(`${baseUrl}/api/v1/auth/roles/${id}/perms`, params);
  },
  getPerms(params, id) {
    return api.get(`${baseUrl}/api/v1/auth/roles/${id}/perms`, params);
  },
  editRole(params, id) {
    return api.post(`${baseUrl}/api/v1/auth/roles/${id}`, params);
  },
  bindRole(params, id) {
    return api.post(`${baseUrl}/api/v1/auth/users/${id}/roles`, params);
  },
  getDevsTime(params, id, id2) {
    return api.get(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/time`,
      params
    );
  },
  manualTime(params, id, id2) {
    return api.post(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/time`,
      params
    );
  },
  getNtp(params, id, id2) {
    return api.get(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/timing/ntp`,
      params
    );
  },
  ntpTime(params, id, id2) {
    return api.post(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/timing/ntp`,
      params
    );
  },
  factoryReset(params, id, id2) {
    return api.post(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/factory-reset`,
      params
    );
  },
  importParams(params, id, id2) {
    return api.post(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/parameters/import`,
      params,
      { "Content-Type": "multipart/form-data" }
    );
  },
  exportParams(params, id, id2) {
    return api.get(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/parameters/export`,
      params
    );
  },
  manualReboot(params, id, id2) {
    return api.post(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/reboot/manual`,
      params
    );
  },
  intervalReboot(params, id, id2) {
    return api.post(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/reboot/auto`,
      params
    );
  },
  getRebootSetting(params, id, id2) {
    return api.get(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/reboot/auto`,
      params
    );
  },
  downloadOcx(params) {
    return api.get(`${baseUrl}/api/v1/devconf_fx/dlfile`, params);
  },
  exportback(params) {
    return api.get(`${baseUrl}/api/v1/devconf_fx/backup`, params);
  },
  oplogs(params) {
    return api.get(`${baseUrl}/api/v1/log/user_oper_logs`, params)
  },
  catstatistics(params) {
    // return api.get(`${baseUrl}/api/v1/log/user_oper_logs`, params)
    let url ="http://192.168.9.146:22222/task/statistics"
    return api.get(`${url}`, params)
  }
};