Ver Fonte

修改登录

11wqe1 há 1 mês atrás
pai
commit
2f8c6ad709

+ 4 - 1
src/lang/cn.json

@@ -143,5 +143,8 @@
 	"Reidentity":"重选身份",
 	"chooseidentity":"请选择您的身份",
 	"teacher":"教师",
-	"student":"学生"
+	"student":"学生",
+	"organization":"组织",
+	"Identifyaccount":"输入账号后识别",
+	"selectlogorg":"请选择登录组织"
 }

+ 4 - 1
src/lang/en.json

@@ -143,5 +143,8 @@
   "Reidentity":"Re select identity",
 	"chooseidentity":"Please choose your identity",
 	"teacher":"teacher",
-	"student":"student"
+	"student":"student",
+  "organization":"organization",
+	"Identifyaccount":"Identify after entering the account",
+	"selectlogorg":"Please select the login organization"
 }

+ 4 - 1
src/lang/hk.json

@@ -143,5 +143,8 @@
 	"Reidentity":"重選身份",
 	"chooseidentity":"請選擇您的身份",
 	"teacher":"教師",
-	"student":"學生"
+	"student":"學生",
+  "organization":"組織",
+	"Identifyaccount":"輸入帳號後識別",
+	"selectlogorg":"請選擇登入組織"
 }

+ 2 - 2
src/views/kanBan/components/dataBoardNew/index.vue

@@ -47,8 +47,8 @@ export default {
   },
   data() {
     return {
-      // gotype: this.$route.query.gotype,
-      gotype: '',
+      gotype: this.$route.query.gotype,
+      // gotype: '',
       useridL: this.$route.query.userid,
       oidL: this.$route.query.oid,
       orgL: this.$route.query.org,

+ 105 - 18
src/views/login/loginPage.vue

@@ -53,26 +53,24 @@
 						>
 						{{ lang.login }}
 						<!-- 返回到选择身份 -->
-						<div v-if="logIdentity != 0" @click="backIDyData" class="backIDy">重选身份</div>
+						<div v-if="logIdentity != 0" @click="backIDyData" class="backIDy">{{ lang.Reidentity }}</div>
 					</span>
 					
 					
 					<!-- 选择身份登录页  -->
 					<div class="logIdy" v-if="logIdentity == 0">
 						<div>
-							请选择您的身份
+							{{ lang.chooseidentity }}
 						</div>
 						<div style="display: flex;gap: 20px;">
 							<div class="logIdImg"  @click="logIdentity = 1">
 								<img src="../../assets/login/logTea.svg"  alt="">
-								<span>教师</span>
+								<span>{{ lang.teacher }}</span>
 							</div>
 							<div class="logIdImg"  @click="logIdentity = 2,getData()">
 								<img src="../../assets/login/logStu.svg" alt="">
-								<span>学生</span>
+								<span>{{ lang.student }}</span>
 							</div>
-							<!-- <el-button size="mini">教师</el-button>
-							<el-button size="mini">学生</el-button> -->
 						</div>
 					</div>
 					<!-- 登录页 -->
@@ -120,11 +118,44 @@
 											type="text"
 											:placeholder="lang.enteraccount"
 											v-model.trim="account"
+											@input="inpGetAccOrgName"
 											@keyup.enter="loginFn"
 										/>
 									</div>
 								</div>
 
+								<div class="fa_i_item" v-if="loginType == 'default' || loginType == 'bind'">
+									<span>{{ lang.organization }}</span>
+									<div>
+										<input
+											v-if="accOrgName.length == 0"
+											disabled
+											type="text"
+											:placeholder="lang.Identifyaccount"
+										/>
+										<input
+											v-else-if="accOrgName.length == 1"
+											disabled
+											type="text"
+											:placeholder="lang.Identifyaccount"
+											v-model="accOrgName[0].name"
+										/>
+										<el-select
+											v-else
+											v-model.trim="org"
+											:placeholder="lang.selectlogorg"
+										>
+											<el-option
+												v-for="item in accOrgName"
+												:key="item.Uorg"
+												:label="item.schoolName"
+												:value="item.Uorg"
+											>
+											</el-option>
+										</el-select>
+									</div>
+								</div>
+
 								<div class="fa_i_item">
 									<span>{{ lang.password }}</span>
 									<div>
@@ -405,6 +436,9 @@ export default {
 			// 后缀
 			org: "",
 			account: "",
+
+			// 查询组织名称 
+			accOrgName:[],
 			password: "",
 			loading: false,
 			loginType: "default",
@@ -585,6 +619,14 @@ export default {
 			const regEmail = new RegExp(
 				"^[A-Za-z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"
 			);
+			if (this.loginType == "default" && !this.org) {
+				this.loading = false;
+				// 请输入组织号
+				if (this.accOrgName.length == 0) {
+					return this.$message.error('请输入完整账号');
+				}
+				return this.$message.error('请选择登录组织');
+			}
 
 			
 			// 组织号页面,没有账号后缀提示需要添加组织号
@@ -607,11 +649,14 @@ export default {
 			}
 			// if (this.loginType != 'orgL') {
 			// 返回2就是多账户,荔园提示联系管理员关闭多余账户,非荔园跳转组织号登录
-			if ((await this.getOrgData()) == 2) {
-				this.loading = false;
-				return
-				// return (this.loginType = "orgL");
+			if (this.loginType == 'orgL') {
+				if ((await this.getOrgData()) == 2) {
+					this.loading = false;
+					return
+					// return (this.loginType = "orgL");
+				}
 			}
+			
 			// }
 
 			// 荔园平台登录账号进行判断
@@ -622,12 +667,19 @@ export default {
 				let _index = this.allowOrgList.findIndex((i) => i.area);
 				let _list = this.allowOrgList[_index].list;
 				if (
-					!_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
+					this.loginType == 'orgL' && this.loginType == 'weChat' && !_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
 				) {
 					this.loading = false;
 					// 账号不可登录,请使用您的专属网址
 					return this.$message.error(this.lang.Accountcannot);
 				}
+
+				if (this.loginType == 'default' && !_list.includes(this.accOrgName.find((i) => i.Uorg == this.org).id)) {
+					this.loading = false;
+					// 账号不可登录,请使用您的专属网址
+					return this.$message.error(this.lang.Accountcannot);
+				}
+
 				// if (
 				// 	this.OrgOptions.find((i) => i.Uorg == this.org) &&
 				// 	!_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
@@ -649,15 +701,25 @@ export default {
 				// 这一步是为了判断登录时,账户是否在组织下有账户问题(但现在获取账户时那部分已经被隐藏,多账号返回数字,这行代码没用了)
 				// if (this.OrgOptions.find((i) => i.Uorg == this.org)) {
 				// console.log('555',this.OrgOptions.find((i) => i.Uorg == this.org).id);
-				if (regEmail.test(str) && this.OrgOptions.find((i) => mergedList.includes(i.id)) && this.OrgOptions.find((i) => mergedList.includes(i.id)).id) {
-					this.loading = false;
-					// 账号不可登录,请使用您的专属网址
-					return this.$message.error(this.lang.Accountcannot);
-				}else if (this.org && this.OrgOptions.find((i) => i.Uorg == this.org) && mergedList.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)) {
+				if (this.loginType == 'orgL' || this.loginType == 'weChat') {
+					if (regEmail.test(str) && this.OrgOptions.find((i) => mergedList.includes(i.id)) && this.OrgOptions.find((i) => mergedList.includes(i.id)).id) {
+						console.log('99999999999');
+						
+						this.loading = false;
+						// 账号不可登录,请使用您的专属网址
+						return this.$message.error(this.lang.Accountcannot);
+					}else if (this.org && this.OrgOptions.find((i) => i.Uorg == this.org) && mergedList.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)) {
+						this.loading = false;
+						// 账号不可登录,请使用您的专属网址
+						return this.$message.error(this.lang.Accountcannot);
+					}
+				}
+				if (this.loginType == 'default' && mergedList.includes(this.accOrgName.find((i) => i.Uorg == this.org).id)) {
 					this.loading = false;
 					// 账号不可登录,请使用您的专属网址
 					return this.$message.error(this.lang.Accountcannot);
 				}
+				
 			}
 
 
@@ -824,6 +886,30 @@ export default {
 				this.$router.push({ path: this.redirect || "/" });
 			}
 		},
+		inpGetAccOrgName(){
+			let params = [
+				{
+					functionName: API_CONFIG.ajax_liYuanOrg.functionName,
+					uname: this.account,
+				},
+			];
+			this.$ajax
+				.post(API_CONFIG.baseUrl, params)
+				.then((res) => {
+					console.log("res", res.data[0]);
+					this.accOrgName = []
+					if (res.data[0].length == 1) {
+						this.org = res.data[0][0].Uorg
+					}else if (res.data[0].length == 0) {
+						this.org = ''
+					}
+					this.accOrgName = [...res.data[0]]
+				})
+				.catch((err) => {
+					console.log(err);
+				});
+		},
+
 		// 输入账号获取组织
 		getOrgData() {
 			return new Promise((resolve) => {
@@ -925,8 +1011,9 @@ export default {
 								// }
 
 								// 该账号须使用“组织号登陆”
-								this.$message.error(this.lang.accountmustOrg);
-								this.loginType = "orgL";
+								// this.$message.error(this.lang.accountmustOrg);
+								
+								// this.loginType = "orgL";
 								return resolve(2);
 
 							}