const actions = { /** * 通过userId获取token * @param {any} commit * @param {string} userId 用户id */ async getUserId({ commit }, userId) { try { const res = await uni.$u.api.getToken(userId); commit('setToken', res.token); commit('setUser', res); return res; } catch (error) { uni.$t.ui.showToast(error.msg || '获取个人信息失败'); } }, }; export default actions;