exportuser.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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, {
  13. skip,
  14. limit,
  15. ...info,
  16. });
  17. return res;
  18. },
  19. async create({ commit }, payload) {
  20. const res = await this.$axios.$post(`${api.expertsuserInfo}`, payload);
  21. return res;
  22. },
  23. async fetch({ commit }, payload) {
  24. const res = await this.$axios.$get(`${api.expertsuserInfo}/${payload}`);
  25. return res;
  26. },
  27. async update({ commit }, { id, ...info } = {}) {
  28. const res = await this.$axios.$post(`${api.expertsuserInfo}/update/${id}`, {
  29. ...info,
  30. });
  31. return res;
  32. },
  33. async delete({ commit }, payload) {
  34. const res = await this.$axios.$delete(`${api.expertsuserInfo}/${payload}`);
  35. return res;
  36. },
  37. async upgrade({ commit }, { id, ...info } = {}) {
  38. const res = await this.$axios.$post(`${api.expertsuserInfo}/upgrade/${id}`, {
  39. ...info,
  40. });
  41. return res;
  42. },
  43. };
  44. export default {
  45. namespaced: true,
  46. state,
  47. mutations,
  48. actions,
  49. };