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

const actions = {
  async create({ commit }, payload) {
    const res = await this.$axios.$post(`${api.loanfollowInfo}`, payload);
    return res;
  },
  async credit({ commit }, payload) {// 授信贷款产品接口
    const res = await this.$axios.$post(`${api.loanfollowInfo}/credit`, payload);
    return res;
  },
  async loanfLists({ commit }, payload) {//授信贷款列表接口
    const res = await this.$axios.$post(`${api.loanfollowInfo}/loanfList`, payload);
    return res;
  },
  async loanfOne({ commit }, payload) {//授信贷款详情
    const res = await this.$axios.$post(`${api.loanfollowInfo}/loanfOne`, payload);
    return res;
  },
  async update({ commit }, { id, ...data }) {
    const res = await this.$axios.$post(`${api.loanfollowInfo}/update/${id}`, data);
    return res;
  },

};
export default {
  namespaced: true,
  state,
  mutations,
  actions,
};
