|
@@ -0,0 +1,24 @@
|
|
|
+import Vue from 'vue';
|
|
|
+import Vuex from 'vuex';
|
|
|
+import _ from 'lodash';
|
|
|
+import axios from 'axios';
|
|
|
+Vue.use(Vuex);
|
|
|
+const api = {
|
|
|
+ calendar: `/jh/calendar/year`,
|
|
|
+};
|
|
|
+const state = () => ({});
|
|
|
+const mutations = {};
|
|
|
+
|
|
|
+const actions = {
|
|
|
+ async calendar({ commit }, { key, year } = {}) {
|
|
|
+ const res = await this.$axios.$get(`${api.calendar}`, { key, year });
|
|
|
+ if (res.error_code == '0') return res.result.data;
|
|
|
+ else this.$message.error(res.reason || '万年历接口请求失败');
|
|
|
+ },
|
|
|
+};
|
|
|
+export default {
|
|
|
+ namespaced: true,
|
|
|
+ state,
|
|
|
+ mutations,
|
|
|
+ actions,
|
|
|
+};
|