dock.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import Vue from 'vue';
  2. import Vuex from 'vuex';
  3. import _ from 'lodash';
  4. Vue.use(Vuex);
  5. const api = {
  6. dockInfo: `/api/live/dock`,
  7. myapplyInfo: `/api/live/dock/myapply`,
  8. };
  9. const state = () => ({});
  10. const mutations = {};
  11. const actions = {
  12. async query({ commit }, { skip = 0, limit = undefined, ...info } = {}) {
  13. const res = await this.$axios.$get(api.dockInfo, { skip, limit, ...info });
  14. return res;
  15. },
  16. async myapply({ commit }, { skip = 0, limit = undefined, ...info } = {}) {
  17. const res = await this.$axios.$get(api.myapplyInfo, {
  18. skip,
  19. limit,
  20. ...info,
  21. });
  22. return res;
  23. },
  24. async create({ commit }, payload) {
  25. const res = await this.$axios.$post(`${api.dockInfo}`, payload);
  26. return res;
  27. },
  28. async fetch({ commit }, payload) {
  29. const res = await this.$axios.$get(`${api.dockInfo}/${payload}`);
  30. return res;
  31. },
  32. async update({ commit }, { id, ...info } = {}) {
  33. const res = await this.$axios.$post(`${api.dockInfo}/${id}`, { ...info });
  34. return res;
  35. },
  36. async delete({ commit }, payload) {
  37. const res = await this.$axios.$delete(`${api.dockInfo}/${payload}`);
  38. return res;
  39. },
  40. async shenhe({ commit }, { id, ...data }) {
  41. const res = await this.$axios.$post(`${api.dockInfo}/check/${id}`, data);
  42. return res;
  43. },
  44. async updateVip({ commit }, { id, ...data }) {
  45. const res = await this.$axios.$post(`${api.dockInfo}/updatevipuser/${id}`, data);
  46. return res;
  47. },
  48. async createvipuser({ commit }, { id, ...data }) {
  49. const res = await this.$axios.$post(`${api.dockInfo}/createvipuser/${id}`, data);
  50. return res;
  51. },
  52. async updateGood({ commit }, { id, ...data }) {
  53. const res = await this.$axios.$post(`${api.dockInfo}/goods/${id}`, data);
  54. return res;
  55. },
  56. };
  57. export default {
  58. namespaced: true,
  59. state,
  60. mutations,
  61. actions,
  62. };