mh-two-thousand-and-two
2024-04-16 d4211fd96865e58217d63efaf4d8f6609fb24ae6
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
27
// 用户模块
// 导入请求
// 存储初始状态cookies
import Cookie from 'js-cookie'
// 权限控制模块
export default {
    namespaced: true,
    state: {
        // token存储在cookie
        token: '',
        // 用户id
        id: 11,
    },
    mutations: {
        set_token: (state, params) => (state.token = params),
        set_id: (state, params) => {
            console.log('sdf');
            state.id = params
        }
    },
    actions: {
        isSet_id(store, role){
            console.log(role);
            store.commit('set_id',role)
        }
    }
}