shish %!s(int64=4) %!d(string=hai) anos
pai
achega
aef59eb9ef
Modificáronse 2 ficheiros con 27 adicións e 40 borrados
  1. 15 20
      ghsApp/src/admin/home/login.vue
  2. 12 20
      hdApp/src/admin/home/login.vue

+ 15 - 20
ghsApp/src/admin/home/login.vue

@@ -181,17 +181,13 @@ export default {
 		mobileLogin(){
 			let that = this
 
-			// if(this.hasMobileNet == false){
-			// 	that.$msg('请关闭wifi,打开流量,再登录')
-			// 	return
-			// }
 
 			if(this.agree == 0){
 				this.$msg('请同意并勾选服务协议和隐私政策')
 				return false				
 			}
 
-			//uni.showLoading({mask:true})
+			uni.showLoading({mask:true})
 			uni.preLogin({
 				provider: 'univerify',
 				success:()=>{
@@ -211,7 +207,7 @@ export default {
 							let access_token = res.authResult.access_token
 							phoneLogin({openid,access_token}).then(subRes=>{
 								let token = subRes.data.token || ''
-								//uni.hideLoading()
+								uni.hideLoading()
 								if (that.$util.isEmpty(token)) {
 									that.$msg('请先注册')
 									return false
@@ -247,30 +243,29 @@ export default {
 							})
 						},
 						fail(res){
-							// 登录失败
+							uni.showToast({title:'登录失败', duration: 3000, icon:'none'})
 							//关闭一键登录弹出窗口
 							uni.closeAuthView()
 							console.log(res)
-							setTimeout(function(){
-								//uni.showToast({ title: '登录失败,请打开流量,关闭wifi,再登录', duration: 3000, icon:'none' })
-							},1000)
 						},
 						complete: (res) => {
-							console.log(res)
+							uni.hideLoading()
 							uni.closeAuthView()
-							//uni.hideLoading()
 						}
 					})
 				},
 				fail(res){  
-					// 预登录失败
-					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭
-					//都有可能造成预登录校验失败
-					console.log(res)
+					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭,都有可能造成预登录校验失败
 					if (res.code == 30005) {
-						//that.$msg('登录失败,请打开流量,再登录')
-						uni.showToast({title: '登录失败,请打开流量,或安装上手机卡', duration: 3000, icon:'none'})
+						uni.showToast({title: '登录失败,请打开移动流量', duration: 3000, icon:'none'})
+					} else if(res.code == 1000) {
+						uni.showToast({title: '即将开通', duration: 3000, icon:'none'})
+					} else if(res.code == 40004) {
+						uni.showToast({title: '即将开通...', duration: 3000, icon:'none'})
+					} else {
+						uni.showToast({title: '登录失败', duration: 3000, icon:'none'})
 					}
+					console.log(res)
 				}
 			})
 		},
@@ -294,10 +289,10 @@ export default {
 				this.$msg('请输入密码')
 				return false
 			}
-			//uni.showLoading({mask:true})
+			uni.showLoading({mask:true})
 			//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
 			appLogin({mobile,password}).then(subRes=>{
-				//uni.hideLoading()
+				uni.hideLoading()
 				if(subRes.code == 1){
 					if (that.$util.isEmpty(subRes)) {
 						return false

+ 12 - 20
hdApp/src/admin/home/login.vue

@@ -173,7 +173,6 @@ export default {
 							that.$util.pageTo({url: "/admin/staff/miniAutoLogin",type: 2})
 							return
 						}
-
 						uni.navigateBack()
 					}
 				});
@@ -184,17 +183,12 @@ export default {
 		mobileLogin(){
 			let that = this
 
-			// if(this.hasMobileNet == false){
-			// 	that.$msg('请关闭wifi,打开流量,再登录')
-			// 	return
-			// }
-
 			if(this.agree == 0){
 				this.$msg('请同意并勾选服务协议和隐私政策')
 				return false
 			}
 
-			//uni.showLoading({mask:true})
+			uni.showLoading({mask:true})
 			uni.preLogin({
 				provider: 'univerify',
 				success:()=>{
@@ -214,7 +208,7 @@ export default {
 							let access_token = res.authResult.access_token
 							phoneLogin({openid,access_token}).then(subRes=>{
 								let token = subRes.data.token || ''
-								//uni.hideLoading()
+								uni.hideLoading()
 								if (that.$util.isEmpty(token)) {
 									that.$msg('请先注册')
 									return false
@@ -252,31 +246,29 @@ export default {
 							})
 						},
 						fail(res){
-							console.log(res)
-							uni.showToast({title:'univerify fail: ' + JSON.stringify(res), duration: 3000, icon:'none'})
-							// 登录失败
+							uni.showToast({title:'登录失败', duration: 3000, icon:'none'})
 							//关闭一键登录弹出窗口
 							uni.closeAuthView()
-							//uni.hideLoading()
+							console.log(res)
 						},
 						complete: (res) => {
-							console.log(res)
+							uni.hideLoading()
 							uni.closeAuthView()
-							//uni.hideLoading()
 						}
 					})
 				},
 				fail(res){
-					console.log(res)
-
-					// 预登录失败
 					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭,都有可能造成预登录校验失败
 					if (res.code == 30005) {
-						//that.$msg('登录失败,请打开流量,再登录')
-						uni.showToast({title: '登录失败,请打开流量,或安装上手机卡', duration: 3000, icon:'none'})
+						uni.showToast({title: '登录失败,请打开移动流量', duration: 3000, icon:'none'})
+					} else if(res.code == 1000) {
+						uni.showToast({title: '即将开通', duration: 3000, icon:'none'})
+					} else if(res.code == 40004) {
+						uni.showToast({title: '即将开通...', duration: 3000, icon:'none'})
 					} else {
-						uni.showToast({title: 'preLogin fail: ' + JSON.stringify(res), duration: 3000, icon:'none'})
+						uni.showToast({title: '登录失败', duration: 3000, icon:'none'})
 					}
+					console.log(res)
 				}
 			})
 		},