cerconfirm.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import Vue from 'vue';
  2. import Vuex from 'vuex';
  3. import axios from 'axios';
  4. import _ from 'lodash';
  5. Vue.use(Vuex);
  6. const api = {
  7. cerconfirmInfo: `/api/train/cerconfirm`,
  8. };
  9. const state = () => ({});
  10. const mutations = {};
  11. const actions = {
  12. async query({ commit }, { skip = 0, limit, ...info } = {}) {
  13. const res = await this.$axios.$get(`${api.cerconfirmInfo}`, { skip, limit, ...info });
  14. return res;
  15. },
  16. async create({ commit }, payload) {
  17. const res = await this.$axios.$post(`${api.cerconfirmInfo}`, payload);
  18. return res;
  19. },
  20. async fetch({ commit }, payload) {
  21. const res = await this.$axios.$get(`${api.cerconfirmInfo}/${payload}`);
  22. return res;
  23. },
  24. async update({ commit }, { id, ...data }) {
  25. const res = await this.$axios.$post(`${api.cerconfirmInfo}/update/${id}`, data);
  26. return res;
  27. },
  28. async delete({ commit }, payload) {
  29. const res = await this.$axios.$delete(`${api.cerconfirmInfo}/${payload}`);
  30. return res;
  31. },
  32. };
  33. export default {
  34. namespaced: true,
  35. state,
  36. mutations,
  37. actions,
  38. };