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.
20 lines
441 B
20 lines
441 B
4 years ago
|
const actions = {
|
||
|
/**
|
||
|
* 通过userId获取token
|
||
|
* @param {any} commit
|
||
|
* @param {string} userId 用户id
|
||
|
*/
|
||
|
async getToken({ commit }, userId) {
|
||
|
try {
|
||
|
const data = await uni.$u.api.getToken(userId);
|
||
|
commit('setToken', data.token);
|
||
|
commit('setUser', data);
|
||
|
return data;
|
||
|
} catch (error) {
|
||
|
uni.$t.ui.showToast(error.msg || '获取个人信息失败');
|
||
|
}
|
||
|
},
|
||
|
};
|
||
|
|
||
|
export default actions;
|