zhoudw
2022-01-10 3755693be0be520deaf92d566f7e5e00d71fdcf5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import mutationTypes from '@/store/mutationTypes.js'
import makeAction from '@/sdk/makeAction.js'
 
const actions = {
    set_token({ commit }, obj) {
        commit('SET_TOKEN', obj);
    },
    set_user_info({ commit }, obj) {
        commit('SET_USER_INFO', obj);
    },
    login_out({ commit }) {
        commit('LOGIN_OUT');
    },
    set_cookie({ commit }) {
        commit('SET_COOKIE');
    },
};
for (const key in mutationTypes) {
    actions[key] = makeAction({
        method: mutationTypes[key].method || 'post',
        url: mutationTypes[key].url,
        config: mutationTypes[key].config || {}
    })
}
 
export default actions