src/store/index.js
@@ -14,7 +14,6 @@ getters, mutations:{ Set_UserName(state,username){ console.log(username,'uuu'); state.username=username } }, @@ -29,11 +28,9 @@ // 监听mutaions 记录state到本地存储 store.subscribe((mutation,state)=>{ uni.setStorageSync('state',state) console.log(state,'statestatestate'); }) // 读取缓存中state if(uni.getStorageSync('state')){ // console.log(state,'aaaaaaaaastatestatestate'); store.replaceState(Object.assign({},store.state,uni.getStorageSync('state'))) } }]