1
YM
2024-06-05 ca4f493cd93c40f09cfde5b49bcbd66f822380cf
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')))
      }
   }]