expertsaudit.js 1.0 KB

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