11wqe1 4 týždňov pred
rodič
commit
4272143e52

BIN
src/assets/login/code.png


BIN
src/assets/login/codel.png


+ 8 - 0
src/common/apiConfig.js

@@ -116,7 +116,15 @@ export const API_CONFIG = {
   ajax_liYuanOrg: {
     functionName: "select_liYuanOrg",
   },
+  //随机码登录查询课程学生账户
+  ajax_selectCourseByIc2: {
+    functionName: "selectCourseByIc2",
+  },
 
+  //根据随机码获取学生
+  ajax_selectSnameByCid: {
+    functionName: "selectSnameByCid",
+  },
   //查询组织
   select_liYuanCampus: {
     functionName: "select_liYuanCampus",

+ 3 - 1
src/store/modules/user.js

@@ -125,7 +125,9 @@ const actions = {
           .catch((error) => {
             // var _user = { userid: "a9c5c04d-1b6f-11f0-a66a-005056924926" }; //刘玉彤
             // var _user = { userid: "e1d282f8-2325-11f0-99d3-005056924926" }; //zjm
-            // var _user = { userid: "0c3735c9-a2ef-11ef-9b30-005056b86db5" }; //yym
+            // var _user = { userid: "0c3735c9-a2ef-11ef-9b30-005056b86db5" }; //yym教师
+            // var _user = { userid: "cd9c6879-2498-11ef-bee5-005056b86db5" }; //yym学生
+
             // var _user = { userid: "5943e08c-b7d4-11ed-8d51-005056b86db5" }; //cs111
             // var _user = { userid: "6c56ec0e-2c74-11ef-bee5-005056b86db5" }; //qgt
             // var _user = { userid: "4fda23d4-1b6f-11f0-a66a-005056924926" }; //管理员

+ 87 - 5
src/views/HomeView.vue

@@ -1,7 +1,7 @@
 <template>
 	<div class="body">
 		<div class="container">
-			<div class="leftBar" style="height: 100%">
+			<div class="leftBar" style="height: 100%" v-if="roleUser.type == 1">
 				<sidebarL
 					@getPer="getPer"
 					@AddAppJson="AddAppJson"
@@ -57,7 +57,7 @@
 				<!-- 首页 -->
 				<homepageL
 					@AddAppJson="AddAppJson"
-					v-show="!appSign"
+					v-show="!appSign && roleUser.type == 1"
 					ref="homepageLRef"
 				></homepageL>
 
@@ -132,9 +132,12 @@ import { API_CONFIG } from "@/common/apiConfig";
 import store from "../store";
 import userInfoA from "../components/userInfoA.vue";
 import homepageL from "./homepageL.vue";
+import { myMixin } from "@/mixins/mixin.js";
 
 export default {
 	name: "HomeView",
+	mixins: [myMixin],
+
 	components: {
 		sidebarL,
 		homepageL,
@@ -144,6 +147,8 @@ export default {
 		return {
 			AppJSon: [],
 			loading: false,
+			// 判断链接时beta还是cloud的
+            betaL:'beta',
 			clearifa: "",
 			// 荔园集团下的学校
 			mergedList: [
@@ -287,14 +292,79 @@ export default {
 					// 取消操作
 				});
 		},
+		async openApp2(val) {
+			let url = "";
+			let argumentList = ["courseId","userid", "oid", "org","cid","tType","screenType"];
+			if (this.betaL == "beta") {
+				url = `https://beta.pbl.cocorobo.cn/pbl-student-table/dist/#/${val.toolId}`;
+			} else {
+				`https://pbl.cocorobo.cn/pbl-student-table/dist/#/${val.toolId}`;
+			}
+// https://beta.pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?courseId=5dc1d643-a2ef-11ef-9b30-005056b86db5&userid=0c3735c9-a2ef-11ef-9b30-005056b86db5&oid=414f2361-ad04-11ed-b13d-005056b86db5&org=0fec3a8a-ad04-11ed-b13d-005056b86db5&cid=&tType=1&screenType=1
+			// return
+			// 点击相同应用不刷新
+			// if (this.appSign == val.toolId) return
+			// 更新标识
+			await store.commit("user/SET_AppSIGN", val.toolId);
+
+			let _userinfo = this.roleUser, //登录用户信息
+				{
+					userid: _userid,
+					organizeid: _oid,
+					org: _org,
+					classid: _classid,
+				} = _userinfo; // 解构赋值获取用户信息
+			let queryString = "";
+			if (argumentList && argumentList.length) {
+				const paramsMap = {
+					courseId: this.$route.query.courseId,
+					userid: _userid,
+					oid: _oid,
+					org: _org,
+					cid: _classid,
+					screenType :3
+				};
+
+				const canshu = argumentList
+					.filter((param) => paramsMap[param] !== undefined || param === "type")
+					.map((param) =>
+						param === "type"
+							? `tType=${paramsMap["tType"]}`
+							: `${param}=${paramsMap[param]}`
+					);
+
+				queryString = canshu.length
+					? (url.includes("?") ? "&" : "?") + canshu.join("&")
+					: ""; // 生成查询字符串
+			}
+
+			let _url = url + queryString;
+			console.log("_url", _url);
 
+			let pl = {
+				json: _url,
+				stateL: true,
+				toolId: val.toolId,
+				clearL: val.clearL,
+			};
+			this.AddAppJson(pl)
+			// this.$emit("cutUrl", pl);
+			this.addOp3(
+				"1",
+				"",
+				{ type: this.prefixL + val.toolId + "stu_open" },
+				"success"
+			);
+		},
 		// 获取学校权限与组织权限,优先使用学校权限,其次使用组织权限
 		async getPer() {
 			this.clearifa = "";
 			// 查询首页应用
 			this.$refs.homepageLRef.getData();
 			//查询cocofrow最近使用与收藏
-			this.$refs.sidebarLRef.getData();
+			if (this.roleUser.type == 1) {
+				this.$refs.sidebarLRef.getData();
+			}
 
 			let params = [
 				{
@@ -445,12 +515,24 @@ export default {
 	},
 	mounted() {
 		console.log("重新获取数据");
+
+        // this.betaL = window.location.href.includes("beta") ? "beta" : "cloud"
+		
+		console.log('this.$route.query.courseId',this.$route.query.courseId);
+		
 		this.getPer();
+		if (this.$route.query.courseId) {
+			this.openApp2({
+				stateL: true,
+				toolId: "courseDetail",
+				clearL: true,
+			});
+		}
 		if (
 			!this.roleUser.cclassid &&
 			this.roleUser.type == 1 &&
-			(!this.roleUser.rrole &&
-			Object.keys(this.userinfo2).length == 0) &&
+			!this.roleUser.rrole &&
+			Object.keys(this.userinfo2).length == 0 &&
 			this.mergedList.includes(this.roleUser.org)
 		) {
 			this.editInfo();

+ 604 - 195
src/views/login/loginPage.vue

@@ -13,143 +13,334 @@
 							:src="showLoginMessage.logo"
 						></el-image>
 					</div>
-					<span v-if="showLoginMessage.name">{{ showLoginMessage.name }}</span>
-					<span style="margin: 0;" v-else>可可乐博智慧教育平台</span>
+					<div
+						style="width: 100%; display: flex; justify-content: space-between"
+					>
+						<div>
+							<div v-if="steps == 1">
+								<span v-if="showLoginMessage.name">{{
+									showLoginMessage.name
+								}}</span>
+								<span style="margin: 0" v-else>可可乐博智慧教育平台</span>
+							</div>
+						</div>
+						<div v-if="steps == 2" style="cursor: pointer" @click="steps = 1">
+							<i style="font-size: 30px;" class="el-icon-back"></i>
+						</div>
+					</div>
 				</div>
-				<span v-if="['default', 'weChat','orgL'].includes(loginType)">登录</span>
-				<span v-if="['bind'].includes(loginType)">绑定账号</span>
-				<div class="lp_r_b_formArea">
-					<div class="fa_input" v-if="['default', 'bind','orgL'].includes(loginType)">
-						<div class="fa_i_item" style="position: relative;" v-if="loginType == 'orgL'">
-							<span>组织号</span>
-							<div>
-								<input
-									type="text"
-									placeholder="请输入组织号"
-									v-model.trim="SuffixData"
-									@input="getSuffix"
-								/>
+				<template v-if="steps == 1">
+					<span v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
+						>登录</span
+					>
+					<span v-if="['bind'].includes(loginType)">绑定账号</span>
+					<div class="lp_r_b_formArea">
+						<!-- 微信绑定,账号登录,组织号登录 -->
+						<div
+							class="fa_input"
+							v-if="['default', 'bind', 'orgL'].includes(loginType)"
+						>
+							<div
+								class="fa_i_item"
+								style="position: relative"
+								v-if="loginType == 'orgL'"
+							>
+								<span>组织号</span>
+								<div>
+									<input
+										type="text"
+										placeholder="请输入组织号"
+										v-model.trim="SuffixData"
+										@input="getSuffix"
+									/>
+								</div>
+								<div
+									style="
+										border: none;
+										font-size: 12px;
+										position: absolute;
+										left: 0;
+										bottom: -70%;
+									"
+									v-if="SuffixData.trim()"
+								>
+									{{ orginfo.length ? orginfo[0].name : "该学校编号不存在" }}
+								</div>
 							</div>
-							<div style="border: none;font-size: 12px;position: absolute;left: 0;bottom: -70%;" v-if="SuffixData.trim()">
-								{{ orginfo.length ? orginfo[0].name :'该学校编号不存在' }}
+							<div class="fa_i_item">
+								<span>账号</span>
+								<div>
+									<!-- @change="getOrgData" -->
+									<input
+										type="text"
+										placeholder="请输入账号"
+										v-model.trim="account"
+										@keyup.enter="loginFn"
+									/>
+								</div>
 							</div>
-						</div>	
-						<div class="fa_i_item">
-							<span>账号</span>
-							<div>
-								<!-- @change="getOrgData" -->
-								<input
-									type="text"
-									placeholder="请输入账号"
-									v-model.trim="account"
-									
-									@keyup.enter="loginFn"
-								/>
+
+							<!-- <div class="fa_i_item">
+								<span>组织</span>
+								<div>
+									<el-select
+										v-model="org"
+										:popper-append-to-body="false"
+										placeholder="请选择"
+										:disabled="
+											(OrgOptions.length == 1 && org) || OrgOptions.length == 0
+										"
+									>
+										<el-option
+											v-for="item in OrgOptions"
+											:key="item.Uorg"
+											:label="
+												item.name
+													? item.name + '-' + item.schoolName
+													: item.schoolName
+											"
+											:value="item.Uorg"
+										>
+										</el-option>
+									</el-select>
+								</div>
+							</div> -->
+
+							<div class="fa_i_item">
+								<span>密码</span>
+								<div>
+									<input
+										type="password"
+										placeholder="请输入密码"
+										v-model="password"
+										@keyup.enter="loginFn"
+									/>
+								</div>
 							</div>
 						</div>
-
-						<!-- <div class="fa_i_item">
-							<span>组织</span>
-							<div>
-								<el-select
-									v-model="org"
-									:popper-append-to-body="false"
-									placeholder="请选择"
-									:disabled="
-										(OrgOptions.length == 1 && org) || OrgOptions.length == 0
+						<!-- 微信登录  -->
+						<div class="fa_weChat" v-if="['weChat'].includes(loginType)">
+							<div id="QRcode" class="QRcode" ref="QRcode"></div>
+							<!-- @click="loginType = 'bind'" -->
+						</div>
+						<!-- 随机码登录  -->
+						<div class="fa_input" v-if="['code'].includes(loginType)">
+							<div class="fa_i_item" style="position: relative">
+								<span>组织号</span>
+								<!-- v-if="prefixL == 'liyuan_'" -->
+								<div v-if="prefixL == 'liyuan_'">
+									<el-select
+										v-loading="Codeloading"
+										@change="getSuffix"
+										v-model="SuffixData"
+										placeholder="请选择"
+									>
+										<el-option
+											v-for="item in CodeOptions"
+											:key="item.code"
+											:label="item.name"
+											:value="item.code"
+										>
+										</el-option>
+									</el-select>
+								</div>
+								<div v-else>
+									<input
+										type="text"
+										placeholder="请输入组织号"
+										v-model.trim="SuffixData"
+										@input="getSuffix"
+									/>
+								</div>
+								<div
+									style="
+										border: none;
+										font-size: 12px;
+										position: absolute;
+										left: 0;
+										bottom: -70%;
 									"
+									v-if="SuffixData.trim() && prefixL != 'liyuan_'"
 								>
-									<el-option
-										v-for="item in OrgOptions"
-										:key="item.Uorg"
-										:label="
-											item.name
-												? item.name + '-' + item.schoolName
-												: item.schoolName
-										"
-										:value="item.Uorg"
-									>
-									</el-option>
-								</el-select>
+									{{ orginfo.length ? orginfo[0].name : "该学校编号不存在" }}
+								</div>
 							</div>
-						</div> -->
-
-						<div class="fa_i_item">
-							<span>密码</span>
-							<div>
-								<input
-									type="password"
-									placeholder="请输入密码"
-									v-model="password"
-									@keyup.enter="loginFn"
-								/>
+
+							<div class="fa_i_item">
+								<span>随机码</span>
+								<div>
+									<!-- @change="getOrgData" -->
+									<input
+										type="text"
+										placeholder="请输入账号"
+										v-model.trim="icode"
+										@keyup.enter="nextSteps"
+									/>
+								</div>
 							</div>
+							<!-- <div class="fa_i_item">
+								<span>组织</span>
+								<div>
+									<el-select
+										v-model="org"
+										:popper-append-to-body="false"
+										placeholder="请选择"
+										:disabled="
+											(OrgOptions.length == 1 && org) || OrgOptions.length == 0
+										"
+									>
+										<el-option
+											v-for="item in OrgOptions"
+											:key="item.Uorg"
+											:label="
+												item.name
+													? item.name + '-' + item.schoolName
+													: item.schoolName
+											"
+											:value="item.Uorg"
+										>
+										</el-option>
+									</el-select>
+								</div>
+							</div> -->
+						</div>
+						<div class="fa_weChat" v-if="['weChat'].includes(loginType)">
+							<div id="QRcode" class="QRcode" ref="QRcode"></div>
+							<!-- @click="loginType = 'bind'" -->
 						</div>
 					</div>
-					<div class="fa_weChat" v-if="['weChat'].includes(loginType)">
-						<div id="QRcode" class="QRcode" ref="QRcode"></div>
-						<!-- @click="loginType = 'bind'" -->
-					</div>
-				</div>
-
-				<div
-					class="lp_r_b_btn"
-					v-if="['default','orgL'].includes(loginType)"
-					@click="loginFn"
-					v-loading="loading"
-				>
-					登录
-				</div>
-				<div
-					class="lp_r_b_btn"
-					v-if="loginType == 'weChat'"
-					style="opacity: 0; cursor: default"
-				>
-					账号密码登录
-				</div>
-				<div class="btn_box" v-if="loginType == 'bind'">
-					<div class="lp_r_b_btn" @click="loginFn" v-loading="loading">
-						确认绑定
-					</div>
-					<div class="lp_r_b_btn" @click="loginType = 'default'">返回登录</div>
-				</div>
-				<div class="lp_r_b_line">
-					<template v-if="['default', 'weChat','orgL'].includes(loginType)">
-						<div></div>
-						<span>其他登录方式</span>
-						<div></div>
-					</template>
-				</div>
-				<div class="lp_r_b_iconBtn">
 
 					<div
-						@click="loginType = 'orgL',org = ''"
-						v-if="['default', 'weChat','orgL'].includes(loginType) && (allowOrgList.findIndex((i) => i.area) == -1)"
+						class="lp_r_b_btn"
+						v-if="['code'].includes(loginType)"
+						@click="nextSteps"
+						v-loading="loading"
 					>
-						<el-tooltip effect="dark" content="组织号登录" placement="bottom">
-							<img :src="loginType == 'orgL' ? require('../../assets/login/zzl.svg') :require('../../assets/login/orgh.svg') "
-							:class="[loginType == 'orgL' ? 'backWin' : '']" />
-						</el-tooltip>
+						确定
 					</div>
-
 					<div
-						@click="wechatLogin"
-						v-if="['default', 'weChat','orgL'].includes(loginType)"
+						class="lp_r_b_btn"
+						v-if="['default', 'orgL'].includes(loginType)"
+						@click="loginFn"
+						v-loading="loading"
 					>
-						<el-tooltip effect="dark" content="微信登录" placement="bottom">
-							<img :src="loginType == 'weChat' ? require('../../assets/login/wxl.svg') :require('../../assets/login/wxh.svg') "
-							:class="[loginType == 'weChat' ? 'backWin' : '']" />
-						</el-tooltip>
+						登录
 					</div>
-
 					<div
-						@click="loginType = 'default',SuffixData = ''"
-						v-if="['default', 'weChat','orgL'].includes(loginType)"
+						class="lp_r_b_btn"
+						v-if="loginType == 'weChat'"
+						style="opacity: 0; cursor: default"
 					>
-						<el-tooltip effect="dark" content="账号密码登录" placement="bottom">
-							<img :src="loginType == 'default' ? require('../../assets/login/zhl.svg') :require('../../assets/login/zhh.svg') "
-							:class="[loginType == 'default' ? 'backWin' : '']" />
-						</el-tooltip>
+						账号密码登录
+					</div>
+					<div class="btn_box" v-if="loginType == 'bind'">
+						<div class="lp_r_b_btn" @click="loginFn" v-loading="loading">
+							确认绑定
+						</div>
+						<div class="lp_r_b_btn" @click="loginType = 'default'">
+							返回登录
+						</div>
+					</div>
+					<div class="lp_r_b_line">
+						<template
+							v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
+						>
+							<div></div>
+							<span>其他登录方式</span>
+							<div></div>
+						</template>
+					</div>
+					<div class="lp_r_b_iconBtn">
+						<div
+							@click="(loginType = 'code')"
+							v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
+						>
+							<el-tooltip effect="dark" content="随机码登录" placement="bottom">
+								<img
+									:src="
+										loginType == 'code'
+											? require('../../assets/login/codel.png')
+											: require('../../assets/login/code.png')
+									"
+									:class="[loginType == 'code' ? 'backWin' : '']"
+								/>
+							</el-tooltip>
+						</div>
+
+						<div
+							@click="(loginType = 'orgL'), (org = '')"
+							v-if="
+								['default', 'weChat', 'orgL', 'code'].includes(loginType) &&
+								allowOrgList.findIndex((i) => i.area) == -1
+							"
+						>
+							<el-tooltip effect="dark" content="组织号登录" placement="bottom">
+								<img
+									style="width: 32px; object-fit: cover"
+									:src="
+										loginType == 'orgL'
+											? require('../../assets/login/zzl.svg')
+											: require('../../assets/login/orgh.svg')
+									"
+									:class="[loginType == 'orgL' ? 'backWin' : '']"
+								/>
+							</el-tooltip>
+						</div>
+
+						<div
+							@click="wechatLogin"
+							v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
+						>
+							<el-tooltip effect="dark" content="微信登录" placement="bottom">
+								<img
+									:src="
+										loginType == 'weChat'
+											? require('../../assets/login/wxl.svg')
+											: require('../../assets/login/wxh.svg')
+									"
+									:class="[loginType == 'weChat' ? 'backWin' : '']"
+								/>
+							</el-tooltip>
+						</div>
+
+						<div
+							@click="(loginType = 'default'), (SuffixData = '')"
+							v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
+						>
+							<el-tooltip
+								effect="dark"
+								content="账号密码登录"
+								placement="bottom"
+							>
+								<img
+									:src="
+										loginType == 'default'
+											? require('../../assets/login/zhl.svg')
+											: require('../../assets/login/zhh.svg')
+									"
+									:class="[loginType == 'default' ? 'backWin' : '']"
+								/>
+							</el-tooltip>
+						</div>
+					</div>
+				</template>
+				<div class="stuPage" v-if="steps == 2">
+					<div>请选择您的姓名</div>
+					<div class="stuList">
+						<!-- <span v-for="i in classJuri" :key="i.userid">{{ i.name }}</span> -->
+						<!-- <div v-for="i in 10" :key="i" @click="selAcc(i)">yym</div> -->
+						<div
+							v-for="i in classJuri"
+							:key="i.userid"
+							:class="[stuInfoCode.userid == i.userid ? 'stuback' : '']"
+							@click="selAcc(i)"
+						>
+							{{ i.name }}
+						</div>
+					</div>
+					<div v-if="!classJuri.length" class="none">此班级暂无学生</div>
+					<div class="lp_r_b_btn" @click="loginCode" v-loading="loading">
+						确定登录
 					</div>
 				</div>
 			</div>
@@ -165,20 +356,32 @@ import "@/common/wxLogin";
 import { getUser } from "@/api/user";
 import { loginOut } from "@/api/user";
 import { GetSuffix } from "@/api/user";
-
-import { myMixin } from "@/mixins/mixin.js"
+import { myMixin } from "@/mixins/mixin.js";
 
 export default {
-	mixins: [ myMixin ],
+	mixins: [myMixin],
 	name: "loginPage",
 	data() {
 		return {
-			// 判断显示组织号区域 
+			// 判断显示组织号区域
 			SuffixShow: false,
 			// 组织号查询区域结果
-			SuffixData:'',
-			orginfo:[],
-			// 后缀 
+			SuffixData: "",
+			orginfo: [],
+			CodeOptions: [],
+			// 随机码
+			icode: "",
+			// 根据随机码获取到的课程id
+			courseId: "",
+			// 随机码登录获取到的课程学生列表
+			classJuri: [],
+			// 随机码荔园登录获code数据加载框
+			Codeloading: false,
+			// 随机码登录页面切换
+			steps: 1,
+			// 随机码选择学生账户信息登录
+			stuInfoCode: {},
+			// 后缀
 			org: "",
 			account: "",
 			password: "",
@@ -202,9 +405,10 @@ export default {
 					area:
 						parent.location.href.includes("lyxx") ||
 						parent.location.href.includes("liyuan"),
-					banner:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/20250421-1139511745206807965.jpg",
-					logo:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/image%2051744962188550.svg",
-					name:"荔园小学教育集团",
+					banner:
+						"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/20250421-1139511745206807965.jpg",
+					logo: "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/image%2051744962188550.svg",
+					name: "荔园小学教育集团",
 					list: [
 						"3823a6a5-1b6e-11f0-a66a-005056924926",
 						"292e34dc-1b6e-11f0-a66a-005056924926",
@@ -226,23 +430,22 @@ export default {
 			}
 		},
 	},
-	computed:{
-		showLoginMessage(){
+	computed: {
+		showLoginMessage() {
 			let _result = {
-				banner:require("@/assets/login2.jpg"),
-				logo:"",
-				name:"",
+				banner: require("@/assets/login2.jpg"),
+				logo: "",
+				name: "",
 			};
 
-			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 _obj = this.allowOrgList[_index];
 				_result.banner = _obj.banner;
 				_result.name = _obj.name;
-				_result.logo = _obj.logo
+				_result.logo = _obj.logo;
 			}
 
-
 			return _result;
 		},
 	},
@@ -252,26 +455,27 @@ export default {
 			logout: "user/logout",
 		}),
 		// 获取组织后缀
-		async getSuffix(){
-			let res = await GetSuffix({mode: this.SuffixData})	
-			console.log('res.data[0]',res.data[0]);
-				
-			if (res.data[0].length) {
-				this.orginfo = res.data[0]
-				this.org = this.orginfo[0].mail
-			}else{
-				this.orginfo = []
-				this.org = ''
+		async getSuffix() {
+			let res = await GetSuffix({ mode: this.SuffixData });
+			console.log("res.data[0]", res.data[0]);
+
+			if (res.data[0].length && this.SuffixData) {
+				this.orginfo = res.data[0];
+				this.org = this.orginfo[0].mail;
+			} else {
+				this.orginfo = [];
+				this.org = "";
 			}
 		},
 		async loginFn() {
 			if (this.loading) return;
 			// loginType == orgL为组织号登录
-			if (this.loginType == 'orgL' && !this.org) return this.$message.error("请输入组织号");
+			if (this.loginType == "orgL" && !this.org)
+				return this.$message.error("请输入组织号");
 
-			// if (this.loginType != 'orgL') {	
-			if (await this.getOrgData() == 2) return this.loginType = 'orgL'
-			// }		
+			// if (this.loginType != 'orgL') {
+			if ((await this.getOrgData()) == 2) return (this.loginType = "orgL");
+			// }
 			const regEmail = new RegExp(
 				"^[A-Za-z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"
 			);
@@ -290,7 +494,9 @@ export default {
 				let _index = this.allowOrgList.findIndex((i) => i.area);
 				// console.log('kkkkkkkkkkk');
 				let _list = this.allowOrgList[_index].list;
-				if (this.OrgOptions.find((i) => i.Uorg == this.org) && !_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
+				if (
+					this.OrgOptions.find((i) => i.Uorg == this.org) &&
+					!_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
 				) {
 					return this.$message.error("账号不可登录,请使用您的专属网址");
 				}
@@ -300,7 +506,7 @@ export default {
 				let mergedList = this.allowOrgList.reduce((acc, curr) => {
 					return [...acc, ...curr.list];
 				}, []);
-				if (this.OrgOptions.find((i) => i.Uorg == this.org)){
+				if (this.OrgOptions.find((i) => i.Uorg == this.org)) {
 					if (
 						mergedList.includes(
 							this.OrgOptions.find((i) => i.Uorg == this.org).id
@@ -308,8 +514,8 @@ export default {
 					) {
 						return this.$message.error("账号不可登录,请使用您的专属网址");
 					}
-				}else{
-						return this.$message.error("还未在此组织下创建账号,请先创建");
+				} else {
+					return this.$message.error("还未在此组织下创建账号,请先创建");
 				}
 			}
 
@@ -319,17 +525,15 @@ export default {
 				// 	"请在账号后添加组织后缀(账号@组织号.com 如:123456@cocorobo.com)"
 				// );
 
-				if (this.allowOrgList.findIndex((i) => i.area) != -1){
+				if (this.allowOrgList.findIndex((i) => i.area) != -1) {
 					this.$message.error(
 						"请在账号后添加组织后缀(账号@组织号.com 如:123456@cocorobo.com)"
 					);
-				}else{
-					this.$message.error(
-						"该账号须使用“组织号登陆”"
-					);
-					this.loginType = 'orgL'
+				} else {
+					this.$message.error("该账号须使用“组织号登陆”");
+					this.loginType = "orgL";
 				}
-				return
+				return;
 			}
 
 			let orgValue = this.org ? "@" + this.org : "@cocorobo.cc";
@@ -341,7 +545,7 @@ export default {
 			} else {
 				email = str;
 			}
-			if (['default','orgL'].includes(this.loginType)) {
+			if (["default", "orgL", "code"].includes(this.loginType)) {
 				let params = {
 					geetest_challenge: "",
 					geetest_validate: "",
@@ -351,7 +555,7 @@ export default {
 				};
 				this.loading = true;
 				axios.defaults.withCredentials = true;
-				console.log("👇",this.prefixL);
+				console.log("👇", this.prefixL);
 				// this.addOp3('1', "", { type:this.prefixL + "login" }, "success",'0c3735c9-a2ef-11ef-9b30-005056b86db5')
 				axios
 					.post("https://beta.api.cocorobo.cn/api/user", qs.stringify(params))
@@ -361,16 +565,18 @@ export default {
 						let userjson = await getUser({ userid: _data.userid });
 						if (userjson.data[0][0].type == 2) {
 							this.loading = false;
-							this.$message.error('无登录权限');
-							return
-						} 
+							this.$message.error("无登录权限");
+							return;
+						}
 
 						console.log("userjson", userjson);
 						if (_data.active === 1) {
 							window.localStorage["identity"] = JSON.stringify(_data.identity);
 							this.$message.success("登录成功");
 							window.topU.U.UF.Cookie.set("cocoroboLoginType=2");
-							window.topU ? window.topU.US.userInfo = _data : window.parent.US.userInfo = _data
+							window.topU
+								? (window.topU.US.userInfo = _data)
+								: (window.parent.US.userInfo = _data);
 							await this.login();
 							if (
 								userjson.data[0][0].type == 1 &&
@@ -382,7 +588,13 @@ export default {
 							} else {
 								this.$router.push({ path: this.redirect || "/" });
 							}
-							this.addOp3('1', "", { type:this.prefixL + "login" }, "success",_data.userid)
+							this.addOp3(
+								"1",
+								"",
+								{ type: this.prefixL + "login" },
+								"success",
+								_data.userid
+							);
 						} else {
 							this.$message.error("登录失败");
 						}
@@ -428,9 +640,9 @@ export default {
 						let userjson = await getUser({ userid: _data.userid });
 						if (userjson.data[0][0].type == 2) {
 							this.loading = false;
-							this.$message.error('无登录权限');
-							return
-						} 
+							this.$message.error("无登录权限");
+							return;
+						}
 
 						console.log("userjson", userjson);
 						if (_data.active === 1) {
@@ -440,7 +652,9 @@ export default {
 							window.localStorage["identity"] = JSON.stringify(_data.identity);
 							this.$message.success("绑定成功");
 							window.topU.U.UF.Cookie.set("cocoroboLoginType=2");
-							window.topU ? window.topU.US.userInfo = _data : window.parent.US.userInfo = _data
+							window.topU
+								? (window.topU.US.userInfo = _data)
+								: (window.parent.US.userInfo = _data);
 							await this.login();
 							if (
 								userjson.data[0][0].type == 1 &&
@@ -495,7 +709,7 @@ export default {
 					.then((res) => {
 						console.log("res", res);
 						// 组织号登陆时不清空
-						if (this.loginType != 'orgL'){
+						if (this.loginType != "orgL") {
 							this.org = "";
 						}
 						this.OrgOptions = [];
@@ -514,25 +728,31 @@ export default {
 						// }
 
 						this.OrgOptions = getList;
-						if (this.OrgOptions.length == 0) return this.$message.error("未查询到账号,请检查是否填写错误或还未创建账号");
-						if (this.loginType == 'orgL') return resolve(1);
-						
+						if (this.OrgOptions.length == 0)
+							return this.$message.error(
+								"未查询到账号,请检查是否填写错误或还未创建账号"
+							);
+						if (this.loginType == "orgL") return resolve(1);
+
 						if (this.OrgOptions.length == 1) {
 							this.org = this.OrgOptions[0].Uorg;
 						} else if (this.OrgOptions.length > 0) {
-							
 							// liyuan走这里
-							if(this.allowOrgList.findIndex((i) => i.area) != -1){
+							if (this.allowOrgList.findIndex((i) => i.area) != -1) {
 								// console.log('1111');
 								try {
 									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;
+									this.org = this.OrgOptions.filter((i) =>
+										_list.includes(i.id)
+									)[0].Uorg;
 								} catch (error) {
 									console.log(error);
-									return this.$message.error("账号不可登录,请使用您的专属网址");
+									return this.$message.error(
+										"账号不可登录,请使用您的专属网址"
+									);
 								}
-							}else{
+							} else {
 								// admin走这里
 								// console.log('2222');
 
@@ -541,17 +761,23 @@ export default {
 								}, []);
 								// console.log('mergedList',mergedList);
 								// console.log('mergedList2',this.OrgOptions.filter(i=>!mergedList.includes(i.id)).length);
-								
-								if(this.OrgOptions.filter(i=>!mergedList.includes(i.id)).length==1) return this.$message.error("账号不可登录,请使用您的专属网址");
+
+								if (
+									this.OrgOptions.filter((i) => !mergedList.includes(i.id))
+										.length == 1
+								)
+									return this.$message.error(
+										"账号不可登录,请使用您的专属网址"
+									);
 								this.$message.error("该账号须使用“组织号登陆”");
-								this.loginType = 'orgL'
+								this.loginType = "orgL";
 								return resolve(2);
 
-							// }
-							// if (this.OrgOptions.map((i) => i.Uorg).includes("@cocorobo.cc")) {
-							// 	this.org = "@cocorobo.cc";
-							// } else {
-							// 	this.org = this.OrgOptions[0].Uorg;
+								// }
+								// if (this.OrgOptions.map((i) => i.Uorg).includes("@cocorobo.cc")) {
+								// 	this.org = "@cocorobo.cc";
+								// } else {
+								// 	this.org = this.OrgOptions[0].Uorg;
 							}
 						}
 						return resolve(1);
@@ -608,6 +834,7 @@ export default {
 				}, 0);
 			}, 0);
 		},
+		// 微信登录
 		async getOpenId(openid) {
 			// oiztX1dwR-W2mBJ5HcvaSEB8yKGY
 			axios.defaults.withCredentials = false;
@@ -645,7 +872,8 @@ export default {
 					if (this.allowOrgList.findIndex((i) => i.area) != -1) {
 						let _index = this.allowOrgList.findIndex((i) => i.area);
 						let _list = this.allowOrgList[_index].list;
-						if (this.OrgOptions.find((i) => i.Uorg == this.org) && 
+						if (
+							this.OrgOptions.find((i) => i.Uorg == this.org) &&
 							!_list.includes(
 								this.OrgOptions.find((i) => i.Uorg == this.org).id
 							)
@@ -672,16 +900,18 @@ export default {
 					}
 					let userjson = await getUser({ userid: _data.userid });
 					if (userjson.data[0][0].type == 2) {
-						this.$message.error('无登录权限');
-						return
-					} 
+						this.$message.error("无登录权限");
+						return;
+					}
 
 					console.log("userjson", userjson);
 					if (_data.active === 1) {
 						window.localStorage["identity"] = JSON.stringify(_data.identity);
 						this.$message.success("登录成功");
 						window.topU.U.UF.Cookie.set("cocoroboLoginType=2");
-						window.topU ? window.topU.US.userInfo = _data : window.parent.US.userInfo = _data
+						window.topU
+							? (window.topU.US.userInfo = _data)
+							: (window.parent.US.userInfo = _data);
 						await this.login();
 						if (
 							userjson.data[0][0].type == 1 &&
@@ -693,7 +923,13 @@ export default {
 						} else {
 							this.$router.push({ path: this.redirect || "/" });
 						}
-						this.addOp3('1', "", { type:this.prefixL + "login" }, "success",_data.userid)
+						this.addOp3(
+							"1",
+							"",
+							{ type: this.prefixL + "login" },
+							"success",
+							_data.userid
+						);
 					} else {
 						this.$message.error("登录失败");
 					}
@@ -709,6 +945,147 @@ export default {
 
 			//
 		},
+		backSteps() {
+			this.steps = 1;
+			this.account = "";
+			this.password = "";
+			this.stuInfoCode = {};
+		},
+		// 随机码登录
+		nextSteps() {
+			let reg = /^\d+$/;
+			if (!reg.test(this.icode)) {
+				this.$message.error("请正确填写随机码");
+				return;
+			}
+
+			let params = [
+				{
+					functionName: API_CONFIG.ajax_selectCourseByIc2.functionName, // 调用存储过程的名称
+					code: this.icode,
+					oid: this.SuffixData,
+				},
+			];
+
+			this.$ajax
+				.post(API_CONFIG.baseUrl, params)
+				.then((res) => {
+					// this.loading = false;
+					if (res.data.length && res.data[0].length) {
+						this.res = res.data[0][0];
+						this.courseId = res.data[0][0].courseId;
+						this.getClass(res.data[0][0].classid);
+					} else {
+						this.$message.error("不存在此随机码");
+					}
+				})
+				.catch((err) => {
+					console.error(err);
+				});
+		},
+		// 根据随机码获取学生
+		getClass(classId) {
+			// let params = {
+			//     cid: classId,
+			// };
+			// this.ajax
+			//     .get(this.$store.state.api + "selectSnameByCid", params)
+			let params = [
+				{
+					functionName: API_CONFIG.ajax_selectSnameByCid.functionName, // 调用存储过程的名称
+					cid: classId,
+				},
+			];
+
+			this.$ajax
+				.post(API_CONFIG.baseUrl, params)
+				.then((res) => {
+					this.classJuri = res.data[0];
+					this.steps = 2;
+				})
+				.catch((err) => {
+					console.error(err);
+				});
+		},
+		// 选择学生账户
+		selAcc(val) {
+			console.log("val", val);
+
+			this.account = val.accountNumber;
+			this.password = val.userpassword;
+			this.stuInfoCode = val;
+		},
+		// 根据随机码获取的账号登录到课程里面
+		async loginCode() {
+			// let courseid = this.courseId;
+			try {
+				await this.$confirm(
+					`确定登录${this.stuInfoCode.username}的账号吗?`,
+					"提示",
+					{
+						confirmButtonText: "确定",
+						cancelButtonText: "取消",
+						type: "warning",
+					}
+				);
+
+				let userjson = await getUser({ userid: this.stuInfoCode.userid });
+
+				console.log("userjson", userjson);
+
+				// window.localStorage["identity"] = JSON.stringify(_data.identity);
+				window.topU.U.UF.Cookie.set("cocoroboLoginType=2");
+
+
+				window.topU.US.userInfo = userjson;
+				window.parent.US.userInfo = userjson;
+
+				this.$message.success("登录成功");
+
+				await this.login();
+
+				// this.$router.push({ path: this.redirect || "/" });
+
+				this.$router.push({ path: '/', query: { courseId: this.courseId } });
+
+				this.addOp3(
+					"1",
+					"",
+					{ type: this.prefixL + "stuCode_login" },
+					"success",
+					userjson.userid
+				);
+			} catch (error) {
+				console.error("登录过程中出错:", error);
+			}
+		},
+		// 获取荔园校区数据
+		getData() {
+			this.loginType = "code";
+			this.org = "";
+			this.Codeloading = true;
+			let params = [
+				{
+					functionName: API_CONFIG.select_liYuanCampus.functionName, // 调用存储过程的名称
+					org: "3823a6a5-1b6e-11f0-a66a-005056924926", //组织id
+				},
+			];
+
+			// 发起请求
+			this.$ajax
+				.post(API_CONFIG.baseUrl, params)
+				.then((res) => {
+					let data = res.data[0];
+					console.log(data);
+
+					this.CodeOptions = data;
+					this.Codeloading = false;
+				})
+				.catch((err) => {
+					this.Codeloading = false;
+					console.error("请求失败,错误信息:", err);
+				});
+		},
 	},
 	mounted() {
 		let _this = this;
@@ -965,7 +1342,39 @@ export default {
 	display: flex;
 	gap: 10px;
 }
+.stuPage {
+	margin: 10px;
+	max-height: 500px;
+	display: flex;
+	flex-direction: column;
+	gap: 20px;
+}
+.stuList {
+	flex: 1;
+	display: grid;
+	max-height: 400px;
+	overflow: auto;
+	grid-template-columns: repeat(4, 1fr);
+	gap: 15px;
+}
+.stuList div {
+	padding: 3px 15px;
+	border-radius: 3px;
+	-webkit-line-clamp: 1;
+	line-height: 22px;
+	display: -webkit-box;
+	-webkit-box-orient: vertical;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	border: 1px #e7e7e7 solid;
+	text-align: center;
+	cursor: pointer;
+}
+.stuback {
+	background: #006afe;
+	color: #fff;
+}
 /* .backWin{ */
-	/* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); */
+/* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); */
 /* }  */
 </style>