import Vue from 'vue';
import Vuex from 'vuex';
import _ from 'lodash';
Vue.use(Vuex);
const api = {
  intelligentFollow: `/api/financial/intelligentFollow`,
};
const state = () => ({});
const mutations = {};

const actions = {

  async query({ commit }, { skip = 0, limit, ...info } = {}) {
    const res = await this.$axios.$get(`${api.intelligentFollow}`, { skip, limit, ...info });
    return res;
  },

  // 关注前请求的接口
  async beforFollow({ commit }, payload) {
    const res = await this.$axios.$post(`${api.intelligentFollow}/beforFollow`,payload);
    return res;
  },
  // 授信
  async credit({ commit }, payload) {
    const res = await this.$axios.$post(`${api.intelligentFollow}/credit`, payload);
    return res;
  },
  // 删除
  async delete({ commit }, payload) {
    const res = await this.$axios.$delete(`${api.intelligentFollow}/${payload}`);
    return res;
  },
  // 列表
  async followIntelligent({ commit }, payload) {
    const res = await this.$axios.$post(`${api.intelligentFollow}/followIntelligent`, payload);
    return res;
  },
};
export default {
  namespaced: true,
  state,
  mutations,
  actions,
};
