You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
613 B
31 lines
613 B
/*
|
|
* @Author: ch
|
|
* @Date: 2022-03-22 18:28:52
|
|
* @LastEditors: ch
|
|
* @LastEditTime: 2022-03-30 16:58:03
|
|
* @Description: file content
|
|
*/
|
|
import Vue from 'vue'
|
|
import Vuex from 'vuex';
|
|
|
|
Vue.use(Vuex)
|
|
|
|
export default new Vuex.Store({
|
|
state : {
|
|
token : uni.getStorageSync('tk') || '',
|
|
userInfo : JSON.parse(uni.getStorageSync('ui') || '{}')
|
|
},
|
|
mutations:{
|
|
SET_TOKEN (state, token = ''){
|
|
state.token = token;
|
|
uni.setStorageSync('tk', token);
|
|
},
|
|
SET_USER_INFO (state, userInfo = {}){
|
|
state.userInfo = userInfo;
|
|
uni.setStorageSync('ui', JSON.stringify(userInfo));
|
|
}
|
|
},
|
|
getters:{
|
|
|
|
}
|
|
}) |