YZM преди 2 години
родител
ревизия
5df1322e7c
променени са 1 файла, в които са добавени 23 реда и са изтрити 0 реда
  1. 23 0
      pages/index/index.vue

+ 23 - 0
pages/index/index.vue

@@ -175,6 +175,29 @@
 			// #ifdef MP
 			this.top = uni.upx2px(150);
 			// #endif
+			
+			// uni.request({
+			// 	url: 'https://jisutqybmf.market.alicloudapi.com/weather/query?city=%E5%AE%89%E9%A1%BA&citycode=citycode&cityid=cityid&ip=ip&location=location',
+			// 	data:{'src':'南京市'},//传入参数
+			// 	method: 'POST',
+			// 	success: res => {
+					
+			// 	}
+			// })
+			    uni.request({
+			        url : "https://jisutqybmf.market.alicloudapi.com/weather/query",
+			        type : "post",
+			        beforeSend : function(req) {
+			            req.setRequestHeader("Authorization", "APPCODE acacbfc4fac24722996q34b284935353562340cd77c8be");
+			        },
+			        dataType : "json",
+			        success : function(data) {
+			            
+			        },
+			        error : function(e) {
+			            alert("网络异常,请重试");
+			        }
+			    });
 
 		},
 		mounted() {