other.js 567 B

123456789101112131415161718192021222324
  1. import Vue from 'vue';
  2. import Vuex from 'vuex';
  3. import _ from 'lodash';
  4. import axios from 'axios';
  5. Vue.use(Vuex);
  6. const api = {
  7. calendar: `/jh/calendar/year`,
  8. };
  9. const state = () => ({});
  10. const mutations = {};
  11. const actions = {
  12. async calendar({ commit }, { key, year } = {}) {
  13. const res = await this.$axios.$get(`${api.calendar}`, { key, year });
  14. if (res.error_code == '0') return res.result.data;
  15. else this.$message.error(res.reason || '万年历接口请求失败');
  16. },
  17. };
  18. export default {
  19. namespaced: true,
  20. state,
  21. mutations,
  22. actions,
  23. };