exportuser.js 1.0 KB

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