1.设置要全局传的值 localStorage.setItem('mRoleIndex', data.user.roleIndex) 2.在使用的地方获取值 var roleIndex = localStorage.getItem('mRoleIndex') 来源:CSDN作者:caohongxia666链接:https://blog.csdn.net/caohongxia666/article/details/104051422 标签 大数据 localstorage