categoryOrder.js 659 Bytes
import urlAlias from '../url';
 import request from '../request';

 const {
  category
 } = urlAlias;

const state = {
  categoryList: [],
};

const mutations = {
  INIT: (state, categoryList) => {
    state.categoryList = categoryList;
  },
};

const actions = {
  fetch({ commit }, param) {
    request({
      url: category,
      success: (res) => {
        commit('INIT', res.data.data)
      },
      fail: (res) => {
        console.log("fail status === > ", res);
      },
      complete: (res) => {
        console.log("complete status === > ", res);
      },
    })
  },
};

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