Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘commit’) 这里我想把token和userInfo分别存入sessionStorage和LocalStorage中,登录提交的时候报commit undefined 问题所在,我们没有在全局中配置store,解决办法如下 在main.js中配置store即可 成功存储