shish 4 lat temu
rodzic
commit
c481c5d834
1 zmienionych plików z 7 dodań i 15 usunięć
  1. 7 15
      ghsApp/src/admin/home/login.vue

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

@@ -60,23 +60,19 @@ export default {
 										that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
 									})
 									that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
-
 									getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
-
 									that.setUserShopAll()
-									that.init()
-
 									// #ifdef APP-PLUS
 									//保存安卓的clientId
 									let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
 									const clientInfo = plus.push.getClientInfo()
 									let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
 									if(hasClientId == '' || hasClientId != currentClientId){
-										replaceClientId({id:currentClientId}).then(res=>{ })
+										replaceClientId({id:currentClientId})
 									}
 									// #endif
+									uni.navigateBack()
 								}
-								
 							})
 						},
 						fail(res){  
@@ -93,8 +89,8 @@ export default {
 				},
 				fail(res){  
 					// 预登录失败
-					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭
-					//都有可能造成预登录校验失败
+					//如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭
+					//都有可能造成预登录校验失败
 				}
 			})
 		},
@@ -103,9 +99,8 @@ export default {
 			uni.showLoading({mask:true})
 			//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
 			appLogin({mobile,password}).then(subRes=>{
-
+				uni.hideLoading()
 				if(subRes.code == 1){
-
 					if (that.$util.isEmpty(subRes)) {
 						return false
 					}
@@ -119,21 +114,18 @@ export default {
 						that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
 					})
 					that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
-
 					getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
-
 					that.setUserShopAll()
-					that.init()
-					uni.hideLoading()
 					// #ifdef APP-PLUS
 					//保存安卓的clientId
 					let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
 					const clientInfo = plus.push.getClientInfo()
 					let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
 					if(hasClientId == '' || hasClientId != currentClientId){
-						replaceClientId({id:currentClientId}).then(res=>{ })
+						replaceClientId({id:currentClientId})
 					}
 					// #endif
+					uni.navigateBack()
 				}
 			})