瀏覽代碼

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

john 2 年之前
父節點
當前提交
4b0ca68d6e
共有 1 個文件被更改,包括 2 次插入2 次删除
  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');