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

const actions = {
  async credit({ commit }, payload) {
    // 授信接口
    const res = await this.$axios.$post(`${api.followInfo}/credit`, payload);
    return res;
  },
  async followlist({ commit }, payload) {
    // 授信关注债权列表
    const res = await this.$axios.$post(`${api.followInfo}/followlist`, payload);
    return res;
  },
  async delete({ commit }, payload) {
    //取消关注
    const res = await this.$axios.$delete(`${api.followInfo}/${payload}`);
    return res;
  },
  async followstock({ commit }, payload) {
    // 授信关注股权列表
    const res = await this.$axios.$post(`${api.followInfo}/followstock`, payload);
    return res;
  },
  async followClaimHistory({ commit }, payload) {
    // 完成债权历史表
    const res = await this.$axios.$post(`${api.followInfo}/followClaimHistory`, payload);
    return res;
  },
};
export default {
  namespaced: true,
  state,
  mutations,
  actions,
};
