gcz 4 лет назад
Родитель
Сommit
f3517d73b2
4 измененных файлов с 29 добавлено и 10 удалено
  1. 7 0
      pages/getout/getout.vue
  2. 8 1
      pages/index/index.vue
  3. 9 3
      pages/login/login.vue
  4. 5 6
      uview-ui/libs/request/index.js

+ 7 - 0
pages/getout/getout.vue

@@ -75,6 +75,13 @@
 					this.roadspaceList = res.data;
 					console.log('handleGetRoadspace',res)
 				}).catch(err=>{
+					if(err.errMsg){
+						this.$refs.uToast.show({
+							title: '请检查网络',
+							type: 'error',
+						});
+						return false;
+					};
 					err.msg&&this.$refs.uToast.show({
 						title: err.msg,
 						type: 'error',

+ 8 - 1
pages/index/index.vue

@@ -146,8 +146,15 @@
 					this.spaceInfo = res.data.spaceInfo;
 					console.log('this.spaceInfo',this.spaceInfo)
 				}).catch(err=>{
+					if(err.errMsg){
+						this.$refs.uToast.show({
+							title: '请检查网络',
+							type: 'error',
+						});
+						return false;
+					};
 					this.$refs.uToast.show({
-						title: err.msg??'请检查网络!',
+						title: err.msg,
 						type: 'error',
 					});
 					console.log('handleGetIndex ',err)

+ 9 - 3
pages/login/login.vue

@@ -30,8 +30,8 @@
 				pic:'https://uviewui.com/common/logo.png',
 				userInfo:[],
 				form:{
-					name:'',
-					password:'',
+					name:'9345',
+					password:'000000',
 					passCheck:false,
 					deviceNo: ''
 				},
@@ -73,7 +73,6 @@
 				this.form.deviceNo = device.getDeviceInfo().deviceId;
 				this.$u.api.login(this.form)
 				.then(res=>{
-					console.log('login',res)
 					this.$refs.uToast.show({
 						title: res.msg,
 						type: 'success',
@@ -94,6 +93,13 @@
 					this.$u.route('pages/index/index', {});
 					console.log('login',res)
 				}).catch(err=>{
+					if(err.errMsg){
+						this.$refs.uToast.show({
+							title: '请检查网络',
+							type: 'error',
+						});
+						return false;
+					};
 					err.msg&&this.$refs.uToast.show({
 						title: err.msg,
 						type: 'error',

+ 5 - 6
uview-ui/libs/request/index.js

@@ -64,12 +64,11 @@ class Request {
 						}
 					} else {
 						// 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
-						if(response.errMsg) {
-							uni.showModal({
-								showCancel:false,
-								title: '请检查网络是否正常'
-							});
-						}
+						// if(response.errMsg) {
+						// 	uni.showModal({
+						// 		title: response.errMsg
+						// 	});
+						// }
 						reject(response)
 					}
 				}