Browse Source

减少一次刷新

zhengkaixin 4 years ago
parent
commit
479c4aabe6
2 changed files with 14 additions and 3 deletions
  1. 2 2
      src/components/Common.vue
  2. 12 1
      src/projects/home/views/User/Login.vue

+ 2 - 2
src/components/Common.vue

@@ -98,12 +98,12 @@
 									path: decodeURIComponent(redirect)
 								});
 							} else {
-								window.location.href = document.URL.replace(/\?code=(.*?)&state=STATE/g, '');
+								//window.location.href = document.URL.replace(/\?code=(.*?)&state=STATE/g, '');
 							}
 						});
 					} else {
 						//如果存在openid,把链接中code字符去除
-						window.location.href = document.URL.replace(/\?code=(.*?)&state=STATE/g, '');
+						///window.location.href = document.URL.replace(/\?code=(.*?)&state=STATE/g, '');
 					}
 				}
 			},

+ 12 - 1
src/projects/home/views/User/Login.vue

@@ -153,10 +153,21 @@
 					mui.toast('请获取并填写验证码');
 				} else {
 					this.isLoading = true;
+					var openid=this.openId;
+					if(!openid){
+						openid=window.localStorage.getItem("xpgj_xsy_wx_openid");
+						
+						if(openid){
+							openid=JSON.parse(openid);
+						}
+					}
+					if(!openid){
+						return
+					}
 					API_Person.validateCode({
 						personId: this.personId,
 						verifyCode: this.verifyCode,
-						openId: this.openId,
+						openId: openid,
 						telephone: this.subForm.phone,
 					}).then(response => {
 						if (response.token) {