dock.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. };
  53. export default {
  54. namespaced: true,
  55. state,
  56. mutations,
  57. actions,
  58. };