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.
26 lines
470 B
26 lines
470 B
const mutations = {
|
|
/**
|
|
* 设置存储token
|
|
* @param {object} state
|
|
* @param {string} token
|
|
*/
|
|
setToken(state, token) {
|
|
if (!token) return;
|
|
state.token = token;
|
|
uni.setStorageSync('token', token);
|
|
},
|
|
|
|
/**
|
|
* 设置user数据
|
|
* @param {object} state
|
|
* @param {object} user
|
|
*/
|
|
setUser(state, user) {
|
|
if (!user) return;
|
|
state.user = { ...user };
|
|
uni.setStorageSync('user', user);
|
|
},
|
|
|
|
};
|
|
|
|
export default mutations;
|
|
|