123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import Vue from 'vue';
- import Vuex from 'vuex';
- import _ from 'lodash';
- Vue.use(Vuex);
- const api = {
- patentchat: `/api/live/v0/patent/patentchat`,
- };
- const state = () => ({});
- const mutations = {};
- const actions = {
- // 用户查询列表
- async query({ commit }, { skip = 0, limit = 10, ...info } = {}) {
- const res = await this.$axios.$get(api.patentchat, { skip, limit, ...info });
- return res;
- },
- // 管理员查询好友列表
- async adminQuery({ commit }, { skip = 0, limit = 10, ...info } = {}) {
- const res = await this.$axios.$get(`${api.patentchat}/chatPerson`, { skip, limit, ...info });
- return res;
- },
- async adminChatQuery({ commit }, { skip = 0, limit = 10, ...info } = {}) {
- const res = await this.$axios.$get(`${api.patentchat}/chatRecord`, { skip, limit, ...info });
- return res;
- },
- async create({ commit }, payload) {
- const res = await this.$axios.$post(`${api.patentchat}`, payload);
- return res;
- },
- async fetch({ commit }, payload) {
- const res = await this.$axios.$get(`${api.patentchat}/${payload}`);
- return res;
- },
- async update({ commit }, { id, ...info } = {}) {
- const res = await this.$axios.$post(`${api.patentchat}/update/${id}`, { ...info });
- return res;
- },
- async delete({ commit }, payload) {
- const res = await this.$axios.$delete(`${api.patentchat}/${payload}`);
- return res;
- },
- };
- export default {
- namespaced: true,
- state,
- mutations,
- actions,
- };
|