From c8dc3d4f33e7548e2d02ba14e9cb770afda5df2b Mon Sep 17 00:00:00 2001
From: whycq <whycq>
Date: 星期四, 24 二月 2022 17:05:41 +0800
Subject: [PATCH] #

---
 pages/basics/comb.vue |   40 +++++++++++++++++++++++++++-------------
 1 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/pages/basics/comb.vue b/pages/basics/comb.vue
index fd35c02..5110bf7 100644
--- a/pages/basics/comb.vue
+++ b/pages/basics/comb.vue
@@ -24,8 +24,8 @@
 			
 		</view>
 		<view>
-			<button class="cu-btn bg-yellow pda-btn" @click="comb()">缁勬墭</button>
-			<button class="cu-btn bg-grey pda-btn" @click="reset">閲嶇疆</button>
+			<button class="cu-btn bg-yellow pda-btn" @click="comb()">缁� 鎵�</button>
+			<button class="cu-btn bg-grey pda-btn" @click="reset">閲� 缃�</button>
 		</view>
 		<view>
 			<!-- 鏅�氬脊绐� -->
@@ -118,11 +118,12 @@
 					return;
 				}
 				uni.request({
-					url:that.baseUrl+"/matCode/auth",
+					url: that.baseHttp + that.baseIP + that.baseUrl + "/matCode/auth",
+					
 					header:{
 						'content-type':'application/x-www-form-urlencoded',
-						'token':localStorage.getItem('token'),	
-					},
+						'token':uni.getStorageSync('token')
+						},
 					data:{
 						id:thatId
 					},
@@ -137,9 +138,12 @@
 								that.unit = data.unit
 							}
 						} else if (res.data.code ===403 ){
-							// 寰呭畾
+							uni.navigateBack({
+							    delta: 1
+							})
 						} else {
-							// 寰呭畾
+							this.messageToggle('error')
+							this.messageText = res.data.msg
 						}
 					}
 					
@@ -196,7 +200,6 @@
 				let that = this
 				let barcode = that.code
 				if(barcode.length === 0){
-					console.log(1)
 					that.messageToggle('error')
 					that.messageText = '鎵樼洏鏉$爜涓虹┖'
 					return;
@@ -213,23 +216,34 @@
 				}
 				uni.request({
 					
-					url:that.baseUrl+"/mobile/comb/auth",
-					header:{'token':localStorage.getItem('token')},
+					url: that.baseHttp + that.baseIP + that.baseUrl + "/mobile/comb/auth",
+					header:{
+						// #ifdef H5
+						'token':uni.getStorageSync('token')
+						// #endif
+						
+						// #ifdef APP-PLUS
+						'token': uni.getStorageSync('token')
+						// Authorization:uni.getStorageSync('token')
+						// #endif
+						},
 					data:{
 						barcode:barcode,
 						combMats:that.matData
 					},
 					method:'POST',
 					success:function(res){
-						console.log(res)
 						if(res.data.code===200){
 							that.reset()
 							that.messageToggle('success')
 							that.messageText = '缁勬墭鎴愬姛'
 						}else if(res.data.data===403){
-							
+							uni.navigateBack({
+							    delta: 1
+							})
 						}else {
-							
+							this.messageToggle('error')
+							this.messageText = res.data.msg
 						}
 					}
 				})

--
Gitblit v1.9.1