Browse Source

修改登录

11wqe1 4 days ago
parent
commit
e77dd44270
1 changed files with 33 additions and 27 deletions
  1. 33 27
      src/views/login/loginPage.vue

+ 33 - 27
src/views/login/loginPage.vue

@@ -37,11 +37,12 @@
 						<div class="fa_i_item">
 						<div class="fa_i_item">
 							<span>账号</span>
 							<span>账号</span>
 							<div>
 							<div>
+								<!-- @change="getOrgData" -->
 								<input
 								<input
 									type="text"
 									type="text"
 									placeholder="请输入账号"
 									placeholder="请输入账号"
 									v-model="account"
 									v-model="account"
-									@change="getOrgData"
+									
 									@keyup.enter="loginFn"
 									@keyup.enter="loginFn"
 								/>
 								/>
 							</div>
 							</div>
@@ -281,18 +282,6 @@ export default {
 				this.$message.error("密码长度不少于6位或者密码包含特殊字符、中文");
 				this.$message.error("密码长度不少于6位或者密码包含特殊字符、中文");
 				return;
 				return;
 			}
 			}
-			
-			let str = this.account.replace(/(^\s*)|(\s*$)/g, "");
-			if (!this.org && !regEmail.test(str)) {
-				// this.$message.error(
-				// 	"请在账号后添加组织后缀(账号@组织号.com 如:123456@cocorobo.com)"
-				// );
-				this.$message.error(
-					"该账号须使用“组织号登陆”"
-				);
-				this.loginType = 'orgL'
-				return
-			}
 
 
 			if (this.allowOrgList.findIndex((i) => i.area) != -1) {
 			if (this.allowOrgList.findIndex((i) => i.area) != -1) {
 				let _index = this.allowOrgList.findIndex((i) => i.area);
 				let _index = this.allowOrgList.findIndex((i) => i.area);
@@ -313,6 +302,17 @@ export default {
 					return this.$message.error("账号不可登录,请使用您的专属网址");
 					return this.$message.error("账号不可登录,请使用您的专属网址");
 				}
 				}
 			}
 			}
+			let str = this.account.replace(/(^\s*)|(\s*$)/g, "");
+			if (!this.org && !regEmail.test(str)) {
+				// this.$message.error(
+				// 	"请在账号后添加组织后缀(账号@组织号.com 如:123456@cocorobo.com)"
+				// );
+				this.$message.error(
+					"该账号须使用“组织号登陆”"
+				);
+				this.loginType = 'orgL'
+				return
+			}
 
 
 			let orgValue = this.org ? "@" + this.org : "@cocorobo.cc";
 			let orgValue = this.org ? "@" + this.org : "@cocorobo.cc";
 			let email = "";
 			let email = "";
@@ -479,19 +479,27 @@ export default {
 						if (this.OrgOptions.length == 1) {
 						if (this.OrgOptions.length == 1) {
 							this.org = this.OrgOptions[0].Uorg;
 							this.org = this.OrgOptions[0].Uorg;
 						} else if (this.OrgOptions.length > 0) {
 						} else if (this.OrgOptions.length > 0) {
-							if(this.allowOrgList.findIndex((i) => i.area) != -1){
-								let _index = this.allowOrgList.findIndex((i) => i.area);
-								let _list = this.allowOrgList[_index].list;
-								this.org = this.OrgOptions.filter(i=>_list.includes(i.id))[0].Uorg;
-							}else{
-								let mergedList = this.allowOrgList.reduce((acc, curr) => {
-								return [...acc, ...curr.list];
-								}, []);
-								if(this.OrgOptions.filter(i=>!mergedList.includes(i.id)).length==1){
-									this.org = this.OrgOptions.filter(i=>!mergedList.includes(i.id))[0].Uorg;
-								}
+							this.$message.error("该账号须使用“组织号登陆”");
+							this.loginType = 'orgL'
+							// liyuan走这里
+							// if(this.allowOrgList.findIndex((i) => i.area) != -1){
+							// 	console.log('1111');
+								
+							// 	let _index = this.allowOrgList.findIndex((i) => i.area);
+							// 	let _list = this.allowOrgList[_index].list;
+							// 	this.org = this.OrgOptions.filter(i=>_list.includes(i.id))[0].Uorg;
+							// }else{
+							// 	// admin走这里
+							// 	console.log('2222');
+
+							// 	let mergedList = this.allowOrgList.reduce((acc, curr) => {
+							// 	return [...acc, ...curr.list];
+							// 	}, []);
+							// 	if(this.OrgOptions.filter(i=>!mergedList.includes(i.id)).length==1){
+							// 		this.org = this.OrgOptions.filter(i=>!mergedList.includes(i.id))[0].Uorg;
+							// 	}
 
 
-							}
+							// }
 							// if (this.OrgOptions.map((i) => i.Uorg).includes("@cocorobo.cc")) {
 							// if (this.OrgOptions.map((i) => i.Uorg).includes("@cocorobo.cc")) {
 							// 	this.org = "@cocorobo.cc";
 							// 	this.org = "@cocorobo.cc";
 							// } else {
 							// } else {
@@ -502,8 +510,6 @@ export default {
 					})
 					})
 					.catch((err) => {
 					.catch((err) => {
 						console.log(err);
 						console.log(err);
-						this.$message.error("获取组织失败,请使用“组织号登陆”");
-						this.loginType = 'orgL'
 					});
 					});
 			});
 			});
 		},
 		},