zs 1 年之前
父節點
當前提交
ff8327b051
共有 2 個文件被更改,包括 4 次插入13 次删除
  1. 1 6
      pages/index/index.vue
  2. 3 7
      unpackage/dist/dev/mp-weixin/pages/index/index.js

+ 1 - 6
pages/index/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="content">
-		<image class="logo" :src="config.logo[0].url||'/static/logo.png'"></image>
+		<image class="logo" :src="config?.logo[0]?.url||'/static/logo.png'"></image>
 	</view>
 </template>
 
@@ -26,11 +26,6 @@
 			uni.setStorage({
 				key: 'config',
 				data: res.data,
-				success: function (arr) {
-				},
-				fail: function (err) {
-					console.log(err);
-				}
 			})
 		}
 	};

+ 3 - 7
unpackage/dist/dev/mp-weixin/pages/index/index.js

@@ -18,12 +18,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         config.value = res.data;
         common_vendor.index.setStorage({
           key: "config",
-          data: res.data,
-          success: function(arr) {
-          },
-          fail: function(err) {
-            console.log(err);
-          }
+          data: res.data
         });
       }
     };
@@ -54,8 +49,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       });
     };
     return (_ctx, _cache) => {
+      var _a2, _b2;
       return {
-        a: config.value.logo[0].url || "/static/logo.png"
+        a: ((_b2 = (_a2 = config.value) == null ? void 0 : _a2.logo[0]) == null ? void 0 : _b2.url) || "/static/logo.png"
       };
     };
   }