Преглед на файлове

添加新随机码登录

11wqe1 преди 3 седмици
родител
ревизия
eb0937d311
променени са 3 файла, в които са добавени 113 реда и са изтрити 14 реда
  1. 4 0
      src/common/apiConfig.js
  2. 3 4
      src/views/kanBan/components/AschoolFeature.vue
  3. 106 10
      src/views/login/loginPage.vue

+ 4 - 0
src/common/apiConfig.js

@@ -146,6 +146,10 @@ export const API_CONFIG = {
     functionName: "selectCourseByIc2",
   },
 
+  //新随机码登录查询课程学生账户
+  ajax_selectCourseByIc2N: {
+    functionName: "selectCourseByIc2N",
+  },
   //根据随机码获取学生
   ajax_selectSnameByCid: {
     functionName: "selectSnameByCid",

+ 3 - 4
src/views/kanBan/components/AschoolFeature.vue

@@ -1577,15 +1577,14 @@ export default {
 		},
 		openNewWindow(val) {
 			console.log(val);
+			// // 基本用法:打开指定 URL
+			window.open(val.url, "_blank");
 			this.addOp3(
 				"1",
 				"",
-				{ id: val.id, name: val.name, type: this.prefixL + "appstoreOpen" },
+				{ id: val.id, name: val.name, type: this.prefixL + (this.userinfo.type == 1 ? '_teacher' : '_student') + + "appstoreOpen" },
 				"success"
 			);
-
-			// // 基本用法:打开指定 URL
-			window.open(val.url, "_blank");
 		},
 		// 办学特色取消
 		feaClo(ind) {

+ 106 - 10
src/views/login/loginPage.vue

@@ -48,7 +48,7 @@
 				</div>
 				<template v-if="steps == 1">
 					<span
-						v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
+						v-if="['default', 'weChat', 'orgL', 'code','code2'].includes(loginType)"
 						style="display: flex;justify-content: space-between;align-items: first baseline;"
 						>
 						{{ lang.login }}
@@ -67,7 +67,7 @@
 								<img src="../../assets/login/logTea.svg"  alt="">
 								<span>{{ lang.teacher }}</span>
 							</div>
-							<div class="logIdImg"  @click="logIdentity = 2,getData()">
+							<div class="logIdImg"  @click="logIdentity = 2,getData('code')">
 								<img src="../../assets/login/logStu.svg" alt="">
 								<span>{{ lang.student }}</span>
 							</div>
@@ -229,7 +229,23 @@
 									</div>
 								</div>
 							</div>
+							<!-- 随机码登录2 -->
+							<div class="fa_input" v-if="['code2'].includes(loginType)">
+								<div class="fa_i_item" style="position: relative">
+									<span>{{ lang.randomcode }}</span>
+									
+									<div>
+										<input
+											type="text"
+											:placeholder="lang.Pleaseenter"
+											v-model.trim="SuffixData"
+											@keyup.enter="nextSteps2"
+										/>
+									</div>
+								</div>
+							</div>
 						</div>
+						<!-- 登录按钮区域开始 -->
 						<div
 							class="lp_r_b_btn"
 							v-if="['code'].includes(loginType)"
@@ -237,6 +253,13 @@
 						>
 							{{ lang.confirm }}
 						</div>
+						<div
+							class="lp_r_b_btn"
+							v-if="['code2'].includes(loginType)"
+							@click="nextSteps2"
+						>
+							{{ lang.confirm }}
+						</div>
 						<div
 							class="lp_r_b_btn"
 							v-if="['default', 'orgL'].includes(loginType)"
@@ -260,9 +283,10 @@
 								{{ lang.Returnlogin }}
 							</div>
 						</div>
+						<!-- 登录按钮区域结束 -->
 						<div class="lp_r_b_line">
 							<template
-								v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
+								v-if="['default', 'weChat', 'orgL', 'code','code2'].includes(loginType)"
 							>
 								<div></div>
 								<span>{{ lang.Otherlogin }}</span>
@@ -270,9 +294,30 @@
 							</template>
 						</div>
 						<div class="lp_r_b_iconBtn">
+							<!-- v-if="['default', 'weChat', 'orgL', 'code','code2'].includes(loginType) && logIdentity == 2 && prefixL != 'liyuan_'" -->
+
 							<div
-								v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType) && logIdentity == 2"
-								@click="getData"
+								v-show="false"
+								@click="getData('code2')"
+							>
+								<el-tooltip
+									effect="dark"
+									:content="lang.Rancodelogin"
+									placement="bottom"
+								>
+									<img
+										:src="
+											loginType == 'code2'
+												? require('../../assets/login/codel.png')
+												: require('../../assets/login/code.png')
+										"
+										:class="[loginType == 'code2' ? 'backWin' : '']"
+									/>
+								</el-tooltip>
+							</div>
+							<div
+								v-if="['default', 'weChat', 'orgL', 'code','code2'].includes(loginType) && logIdentity == 2"
+								@click="getData('code')"
 							>
 								<!-- v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)" -->
 								<el-tooltip
@@ -294,7 +339,7 @@
 							<div
 								@click="(loginType = 'orgL'), (org = '')"
 								v-if="
-									['default', 'weChat', 'orgL', 'code'].includes(loginType) &&
+									['default', 'weChat', 'orgL', 'code','code2'].includes(loginType) &&
 									allowOrgList.findIndex((i) => i.area) == -1 && logIdentity == 1
 								"
 							>
@@ -317,7 +362,7 @@
 
 							<div
 								@click="wechatLogin"
-								v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType) && logIdentity == 1"
+								v-if="['default', 'weChat', 'orgL', 'code','code2'].includes(loginType) && logIdentity == 1"
 							>
 								<el-tooltip
 									effect="dark"
@@ -337,7 +382,7 @@
 
 							<div
 								@click="Seldefault"
-								v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
+								v-if="['default', 'weChat', 'orgL', 'code','code2'].includes(loginType)"
 							>
 								<el-tooltip
 									effect="dark"
@@ -1343,7 +1388,57 @@ export default {
 						this.nextStepsLoading = false
 						this.$message.error(this.lang.codenotexist);
 					}
+				})
+				.catch((err) => {
+					this.nextStepsLoading = false
+
+					console.error(err);
+				});
+		},
+		// 随机码2登录
+		nextSteps2() {
+			if (this.SuffixData.length < 5) {
+				this.$message.error('请输入正确课程识别码');
+				return;
+			}
+
+			let suf = this.SuffixData.slice(0,4) //组织号
+			let cod = this.SuffixData.slice(4)    //课程识别码
+
+			console.log('suf',suf);
+			console.log('cod',cod);
+
+			this.nextStepsLoading = true
+			let reg = /^\d+$/;
+			if (!reg.test(cod)) {
+				this.$message.error(this.lang.codecorrectly);
+				this.nextStepsLoading = false
+				return;
+			}
+
+			let params = [
+				{
+					functionName: API_CONFIG.ajax_selectCourseByIc2N.functionName, // 调用存储过程的名称
+					// code: this.icode,
+					// oid: this.SuffixData,
+					code: cod,
+					oid: suf,
+				},
+			];
 
+			this.$ajax
+				.post(API_CONFIG.baseUrl, params)
+				.then(async (res) => {
+					if (res.data.length && res.data[0].length) {
+						this.codeRes = res.data[0][0];
+						this.courseId = res.data[0][0].courseId;
+						let oid = res.data[0][0].organizeid;
+						await this.getClassName(res.data[0][0].classid)
+						this.getClass(res.data[0][0].classid,oid);
+					} else {
+						this.nextStepsLoading = false
+						this.$message.error(this.lang.codenotexist);
+					}
 				})
 				.catch((err) => {
 					this.nextStepsLoading = false
@@ -1531,9 +1626,10 @@ export default {
 			}
 		},
 		// 获取荔园校区数据
-		getData() {
-			this.loginType = "code";
+		getData(val) {
+			this.loginType = val;
 			this.SuffixData = "";
+			if (this.prefixL != 'liyuan_' || val == 'code2') return
 			this.Codeloading = true;
 			let params = [
 				{