Ver Fonte

当从支付页面返回后,防止刷新其他页面

john há 2 anos atrás
pai
commit
4b0ca68d6e
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      src/App.vue

+ 2 - 2
src/App.vue

@@ -103,14 +103,14 @@ export default {
         // 保留 carList
         const carList = uni.getStorageSync('carList');
         // 保留 buildingId
-        const buildingId = uni.getStorageSync('buildingId');
+        const buildingId = window.localStorage.getItem('buildingId')
         // 每次进入页面清空 缓存数据
         window.localStorage.clear();
         if (carList) {
           uni.setStorageSync('carList', JSON.parse(carList));
         }
         if (buildingId) {
-          uni.setStorageSync('buildingId', JSON.parse(buildingId));
+          window.localStorage.setItem('buildingId', buildingId)
         }
         this.$store.commit('SET_IS_INIT', false);
         window.token = `${window.location.href}`.replace(/.*wx\/(.*)\/.*/g, '$1');