11wqe1 пре 1 недеља
родитељ
комит
9388e38aba
4 измењених фајлова са 262 додато и 205 уклоњено
  1. 1 1
      src/lang/cn.json
  2. 1 1
      src/lang/en.json
  3. 1 1
      src/lang/hk.json
  4. 259 202
      src/views/login/loginPage.vue

+ 1 - 1
src/lang/cn.json

@@ -139,5 +139,5 @@
 	"Formrate": "表单回收率",
 	"Intelfrequency": "智能回答次数",
 	"backoldversion":"确定回到旧版吗?",
-	"liyuanAccMore":"校区账号多出,请联系管理员"
+	"liyuanAccMore":"账号存在多个校区信息,请联系管理员"
 }

+ 1 - 1
src/lang/en.json

@@ -139,5 +139,5 @@
   "Formrate": "Form response rate",
   "Intelfrequency": "Intelligent response frequency",
 	"backoldversion":"Are you sure to go back to the old version?",
-	"liyuanAccMore":"There are multiple campus accounts, please contact the administrator"
+	"liyuanAccMore":"There are multiple campus information in the account, please contact the administrator"
 }

+ 1 - 1
src/lang/hk.json

@@ -139,6 +139,6 @@
   "Formrate": "表單回收率",
   "Intelfrequency": "智能回答次數",
   "backoldversion":"確定回到舊版嗎?",
-  "liyuanAccMore":"校区账号多出,请联系管理员"
+  "liyuanAccMore":"账号存在多个校区信息,请联系管理员"
 
 }

+ 259 - 202
src/views/login/loginPage.vue

@@ -4,10 +4,14 @@
 			<img :src="showLoginMessage.banner" />
 		</div>
 		<div class="lp_right">
-			<div v-if="allowOrgList.findIndex((i) => i.area) == -1" @click="backVersion" class="Version">
+			<div
+				v-if="allowOrgList.findIndex((i) => i.area) == -1"
+				@click="backVersion"
+				class="Version"
+			>
 				{{ lang.Returnoldversion }}
 			</div>
-			<div class="lp_r_box">			
+			<div class="lp_r_box">
 				<div class="lp_r_b_logo">
 					<div>
 						<el-image
@@ -17,7 +21,12 @@
 						></el-image>
 					</div>
 					<div
-						style="width: 100%; display: flex; justify-content: space-between;align-items: center;"
+						style="
+							width: 100%;
+							display: flex;
+							justify-content: space-between;
+							align-items: center;
+						"
 					>
 						<div v-if="steps == 1">
 							<span v-if="showLoginMessage.name">{{
@@ -26,24 +35,31 @@
 							<span style="margin: 0" v-else>{{ lang.KekeleboPlatform }}</span>
 						</div>
 						<div v-if="steps == 2">
-							<div style="margin-left: 10px;">{{ this.codeRes.school }}</div>
+							<div style="margin-left: 10px">{{ this.codeRes.school }}</div>
 						</div>
-						<div v-if="steps == 2" style="cursor: pointer" @click="steps = 1,stuInfoCode = {}">
+						<div
+							v-if="steps == 2"
+							style="cursor: pointer"
+							@click="(steps = 1), (stuInfoCode = {})"
+						>
 							<i style="font-size: 30px" class="el-icon-back"></i>
 						</div>
 					</div>
 				</div>
 				<template v-if="steps == 1">
-					<span v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
+					<span
+						v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
 						>{{ lang.login }}</span
 					>
-					<span v-if="['bind'].includes(loginType)">{{ lang.Bindaccount }}</span>
+					<span v-if="['bind'].includes(loginType)">{{
+						lang.Bindaccount
+					}}</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"
@@ -74,7 +90,6 @@
 							<div class="fa_i_item">
 								<span>{{ lang.account }}</span>
 								<div>
-									<!-- @change="getOrgData" -->
 									<input
 										type="text"
 										:placeholder="lang.enteraccount"
@@ -156,7 +171,6 @@
 									/>
 								</div>
 							</div>
-
 						</div>
 					</div>
 
@@ -201,9 +215,16 @@
 						</template>
 					</div>
 					<div class="lp_r_b_iconBtn">
-						<div v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)" @click="getData">
+						<div
+							v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
+							@click="getData"
+						>
 							<!-- v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)" -->
-							<el-tooltip effect="dark" :content="lang.Rancodelogin" placement="bottom">
+							<el-tooltip
+								effect="dark"
+								:content="lang.Rancodelogin"
+								placement="bottom"
+							>
 								<img
 									:src="
 										loginType == 'code'
@@ -222,7 +243,11 @@
 								allowOrgList.findIndex((i) => i.area) == -1
 							"
 						>
-							<el-tooltip effect="dark" :content="lang.OrgIDLogin" placement="bottom">
+							<el-tooltip
+								effect="dark"
+								:content="lang.OrgIDLogin"
+								placement="bottom"
+							>
 								<img
 									style="width: 32px; object-fit: cover"
 									:src="
@@ -239,7 +264,11 @@
 							@click="wechatLogin"
 							v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
 						>
-							<el-tooltip effect="dark" :content="lang.WeChatLogin" placement="bottom">
+							<el-tooltip
+								effect="dark"
+								:content="lang.WeChatLogin"
+								placement="bottom"
+							>
 								<img
 									:src="
 										loginType == 'weChat'
@@ -252,7 +281,7 @@
 						</div>
 
 						<div
-							@click="(loginType = 'default'), (SuffixData = '')"
+							@click="(loginType = 'default'), ((SuffixData = ''), (org = ''))"
 							v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)"
 						>
 							<el-tooltip
@@ -277,18 +306,18 @@
 					<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)"
-							>
-								<el-tooltip effect="dark" :content="i.name" placement="top">
-									<span>
-										{{ i.name }}
-									</span> 
-								</el-tooltip>
-							</div>
+						<div
+							v-for="i in classJuri"
+							:key="i.userid"
+							:class="[stuInfoCode.userid == i.userid ? 'stuback' : '']"
+							@click="selAcc(i)"
+						>
+							<el-tooltip effect="dark" :content="i.name" placement="top">
+								<span>
+									{{ i.name }}
+								</span>
+							</el-tooltip>
+						</div>
 					</div>
 					<div v-if="!classJuri.length" class="none">{{ lang.nostudents }}</div>
 					<div class="lp_r_b_btn" @click="loginCode" v-loading="loading">
@@ -305,7 +334,7 @@ import axios from "axios";
 import qs from "qs";
 import { API_CONFIG } from "@/common/apiConfig";
 import "@/common/wxLogin";
-import { getUser, loginOut,GetSuffix } from "@/api/user";
+import { getUser, loginOut, GetSuffix } from "@/api/user";
 import { myMixin } from "@/mixins/mixin.js";
 
 export default {
@@ -318,7 +347,7 @@ export default {
 			// 组织号查询区域结果
 			SuffixData: "",
 			orginfo: [],
-			codeRes:'',
+			codeRes: "",
 			CodeOptions: [],
 			// 随机码
 			icode: "",
@@ -402,10 +431,13 @@ export default {
 			return _result;
 		},
 		userRequest() {
-			console.log('this.$region',this.$region);
+			console.log("this.$region", this.$region);
+
+			let _result =
+				this.$region == "hk"
+					? "https://cloud.api.cocorobo.hk/api/user"
+					: "https://beta.api.cocorobo.cn/api/user";
 
-			let _result = this.$region == 'hk' ? 'https://cloud.api.cocorobo.hk/api/user' : 'https://beta.api.cocorobo.cn/api/user'
-			
 			return _result;
 		},
 	},
@@ -415,36 +447,37 @@ export default {
 			logout: "user/logout",
 		}),
 		// 返回旧版本
-		backVersion(){
+		backVersion() {
 			this.$confirm(this.lang.backoldversion, this.lang.tip, {
 				confirmButtonText: this.lang.confirm,
 				cancelButtonText: this.lang.Cancel,
 				type: "warning",
 			})
-			.then(() => {
-				console.log(this.$region);
-				if (this.$region == 'beta') {
-					window.topU.location.href = 'https://beta.cloud.cocorobo.cn/index.html'
-				}else if(this.$region == 'hk'){
-					window.topU.location.href = 'https://cloud.cocorobo.hk/'
-				}else{
-					window.topU.location.href = 'https://cloud.cocorobo.cn/index.html'
-				}
-			})
-			.catch(() => {});
+				.then(() => {
+					console.log(this.$region);
+					if (this.$region == "beta") {
+						window.topU.location.href =
+							"https://beta.cloud.cocorobo.cn/index.html";
+					} else if (this.$region == "hk") {
+						window.topU.location.href = "https://cloud.cocorobo.hk/";
+					} else {
+						window.topU.location.href = "https://cloud.cocorobo.cn/index.html";
+					}
+				})
+				.catch(() => {});
 		},
 		// 随机码获取组织后缀
 		async getrandomcodeSuffix() {
 			let params = [
 				{
 					functionName: API_CONFIG.ajax_getliyuanCode.functionName,
-					mode: this.SuffixData
+					mode: this.SuffixData,
 				},
 			];
 			const res = await this.$ajax.post(API_CONFIG.baseUrl, params);
 			let data = [...res.data[0], ...res.data[1]];
-			console.log('data', data);
-			
+			console.log("data", data);
+
 			if (data.length) {
 				this.orginfo = data;
 				this.org = this.orginfo[0].mail;
@@ -455,11 +488,11 @@ export default {
 		},
 		// 获取组织后缀
 		async getSuffix() {
-			if (!this.SuffixData){
+			if (!this.SuffixData) {
 				this.orginfo = [];
 				this.org = "";
-				return
-			} 
+				return;
+			}
 			let res = await GetSuffix({ mode: this.SuffixData });
 			console.log("res.data[0]", res.data[0]);
 
@@ -470,38 +503,37 @@ export default {
 				this.orginfo = [];
 				this.org = "";
 			}
-			// let res = await getliyuanCode({ mode: this.SuffixData });
-			// console.log("res.data", res.data);
-
-			// 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为组织号登录
 			let str = this.account.replace(/(^\s*)|(\s*$)/g, "");
+			console.log('str',str);
+			
+			// 判断账号是否有后缀
 			const regEmail = new RegExp(
 				"^[A-Za-z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"
 			);
-			if (this.loginType == "orgL" && !this.org && !regEmail.test(str)){
+
+			// 组织号页面,没有账号后缀提示需要添加组织号
+			if (this.loginType == "orgL" && !this.org && !regEmail.test(str)) {
 				this.loading = false;
+				// 请输入组织号
 				return this.$message.error(this.lang.enterorgnumber);
 			}
+
 			this.loading = true;
 
 			// if (this.loginType != 'orgL') {
-			if ((await this.getOrgData()) == 2){
+			// 返回2就是多账户,荔园提示联系管理员关闭多余账户,非荔园跳转组织号登录
+			if ((await this.getOrgData()) == 2) {
 				this.loading = false;
-				return (this.loginType = "orgL");
-			} 
+				return
+				// return (this.loginType = "orgL");
+			}
 			// }
-			
+
 			if (this.account.length <= 0) {
 				this.$message.error(this.lang.enteraccount);
 				this.loading = false;
@@ -516,69 +548,77 @@ 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) &&
-					!_list.includes(this.OrgOptions.find((i) => i.Uorg == this.org).id)
+					!_list.includes(this.OrgOptions[0].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)
+				// ) {
+				// 	this.loading = false;
+				// 账号不可登录,请使用您的专属网址
+				// 	return this.$message.error(this.lang.Accountcannot);
+				// }
 			} else {
-
+				// 非荔园登录时
+				// 取荔园校区list
 				let mergedList = this.allowOrgList.reduce((acc, curr) => {
 					return [...acc, ...curr.list];
 				}, []);
 				// let str = this.account.replace(/(^\s*)|(\s*$)/g, "");
-				console.log('regEmail.test(str)',!regEmail.test(str),this.org);
-				
-				if (this.OrgOptions.find((i) => i.Uorg == this.org)) {
-					if (
-						mergedList.includes(
-							this.OrgOptions.find((i) => i.Uorg == this.org).id
-						)
-					) {
-						this.loading = false;
-						return this.$message.error(this.lang.Accountcannot);
-					}
-				} else {
-					if (regEmail.test(str)) {
-						if (this.OrgOptions.find((i) => i.Uorg == str)) {
-							if (
-								mergedList.includes(
-									this.OrgOptions.find((i) => i.Uorg == str).id
-								)
-							) {
-								this.loading = false;
-								return this.$message.error(this.lang.Accountcannot);
-							}
-						}
-					}else{
-						this.loading = false;
-						return this.$message.error(this.lang.accountnotcreated);
-					}
+				// console.log("regEmail.test(str)", !regEmail.test(str), this.org);
 
+				// 这一步是为了判断登录时,账户是否在组织下有账户问题(但现在获取账户时那部分已经被隐藏,多账号返回数字,这行代码没用了)
+				// if (this.OrgOptions.find((i) => i.Uorg == this.org)) {
+				if (mergedList.includes(this.OrgOptions[0].id)) {
+					this.loading = false;
+					// 账号不可登录,请使用您的专属网址
+					return this.$message.error(this.lang.Accountcannot);
 				}
+
+				// } else {
+				// 	if (regEmail.test(str)) {
+				// 		if (this.OrgOptions.find((i) => i.Uorg == str)) {
+				// 			if (
+				// 				mergedList.includes(
+				// 					this.OrgOptions.find((i) => i.Uorg == str).id
+				// 				)
+				// 			) {
+				// 				this.loading = false;
+				// 				// 账号不可登录,请使用您的专属网址
+				// 				return this.$message.error(this.lang.Accountcannot);
+				// 			}
+				// 		}
+				// 	} else {
+				// 		this.loading = false;
+				// 		// 还未在此组织下创建账号,请先创建
+				// 		return this.$message.error(this.lang.accountnotcreated);
+				// 	}
+				// }
 			}
 
 			// let str = this.account.replace(/(^\s*)|(\s*$)/g, "");
-			if (!this.org && !regEmail.test(str)) {
-				// this.$message.error(
-				// 	"请在账号后添加组织后缀(账号@组织号.com 如:123456@cocorobo.com)"
-				// );
-
-				if (this.allowOrgList.findIndex((i) => i.area) != -1) {
-					this.$message.error(
-						this.lang.addsuffix
-					);
-				} else {
-					this.$message.error(this.lang.accountmustOrg);
-					this.loginType = "orgL";
-				}
-				this.loading = false;
-				return;
-			}
+			// 组织号登录时,没有获取到后缀也没有手动填后缀(上面已经写过了)
+			// if (!this.org && !regEmail.test(str)) {
+			// 	// if (this.allowOrgList.findIndex((i) => i.area) != -1) {
+			// 	// 	// 请在账号后添加组织后缀(账号@组织号.com 如:123456@cocorobo.com)
+			// 		this.$message.error(this.lang.addsuffix);
+			// 	// } 
+			// 	// else {
+			// 	// 	// 该账号须使用“组织号登陆”
+			// 	// 	this.$message.error(this.lang.accountmustOrg);
+			// 	// 	this.loginType = "orgL";
+			// 	// }
+			// 	this.loading = false;
+			// 	return;
+			// }
 
 			let orgValue = this.org ? "@" + this.org : "@cocorobo.cc";
 			let email = "";
@@ -615,7 +655,7 @@ export default {
 						console.log("userjson", userjson);
 						if (_data.active === 1) {
 							window.localStorage["identity"] = JSON.stringify(_data.identity);
-							
+
 							window.topU.U.UF.Cookie.set("cocoroboLoginType=2");
 							window.topU
 								? (window.topU.US.userInfo = _data)
@@ -645,7 +685,7 @@ export default {
 						this.loading = false;
 					})
 					.catch((e) => {
-						if (e.response && e.response.data == "Wrong email or password") {
+						if (e.response && (e.response.data == "Wrong email or password" || e.response.data == '错误邮箱和密码')) {
 							this.$message.error(this.lang.Accerror);
 						} else {
 							this.$message.error(this.lang.Loginfailed);
@@ -720,7 +760,7 @@ export default {
 					})
 					.catch((e) => {
 						console.log(e);
-						
+
 						if (e.response && e.response.data == "Wrong email or password") {
 							this.$message.error(this.lang.Accerror);
 						} else {
@@ -748,7 +788,7 @@ export default {
 			return new Promise((resolve) => {
 				let params = [
 					{
-						functionName: API_CONFIG.ajax_liYuanOrg.functionName,
+						functionName: API_CONFIG.ajax_liYuanAcc.functionName,
 						uname: this.account,
 					},
 				];
@@ -756,13 +796,13 @@ export default {
 					.post(API_CONFIG.baseUrl, params)
 					.then((res) => {
 						console.log("res", res);
-						// 组织号登陆时不清空
-						if (this.loginType != "orgL") {
-							this.org = "";
-						}
-						this.OrgOptions = [];
+						// 组织号登陆时不清空(this.org只有组织号赋值,还有登陆时ajax_liYuanAcc赋值,所以非组织号登录时要清空,让他在下面赋值)
+						// if (this.loginType != "orgL") {
+						// 	this.org = "";
+						// }
+						// this.OrgOptions = [];
 
-						let getList = res.data[0];
+						// let getList = res.data[0];
 
 						// if (this.allowOrgList.findIndex((i) => i.area) != -1) {
 						// 	let _index = this.allowOrgList.findIndex((i) => i.area);
@@ -775,51 +815,61 @@ export default {
 						// 	getList = getList.filter((i) => !mergedList.includes(i.id));
 						// }
 
-						this.OrgOptions = getList;
-						if (this.OrgOptions.length == 0){
+						this.OrgOptions = res.data[0];
+
+						// 未查询到账户,
+						if (this.OrgOptions[0].num == 0){
 							this.loading = false
+							resolve(2);
+							// 未查询到账号,请检查是否填写错误或还未创建账号
 							return this.$message.error(
 								this.lang.Accnotfound
 							);
 						}
-							
+
+						// 这一步应该是组织号登录时必须要填组织号时有用,现在没用了---这句话的区域用的(但现在获取账户时那部分已经被隐藏)
+						// 有用,组织号登录时就不让他往下走了,防止多账号问题与组织号登录冲突,去除这行影响组织号登录往下执行,
 						if (this.loginType == "orgL") return resolve(1);
 
-						if (this.OrgOptions.length == 1) {
+						if (this.OrgOptions[0].num == 1) {
 							this.org = this.OrgOptions[0].Uorg;
-						} else if (this.OrgOptions.length > 0) {
+						} else {
+							// 多账号时
 							// liyuan走这里
 							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;
-								} catch (error) {
-									console.log(error);
-									this.loading = false
-									return this.$message.error(
-										this.lang.Accountcannot
-									);
-								}
+								// 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;
+								// } catch (error) {
+								// 	console.log(error);
+								// 	this.loading = false
+								// 	return this.$message.error(
+								// 		this.lang.Accountcannot
+								// 	);
+								// }
+								
+								this.$message.error(this.lang.liyuanAccMore);
+								return resolve(2);
 							} else {
 								// admin走这里
-
-								let mergedList = this.allowOrgList.reduce((acc, curr) => {
-									return [...acc, ...curr.list];
-								}, []);
-
-								if (
-									this.OrgOptions.filter((i) => !mergedList.includes(i.id))
-										.length == 1
-								){
-									this.loading = false
-									return this.$message.error(
-										this.lang.Accountcannot
-									);
-								}
+								// let mergedList = this.allowOrgList.reduce((acc, curr) => {
+								// 	return [...acc, ...curr.list];
+								// }, []);
+
+								// if (
+								// 	this.OrgOptions.filter((i) => !mergedList.includes(i.id))
+								// 		.length == 1
+								// ){
+								// 	this.loading = false
+								// 	return this.$message.error(
+								// 		// 账号不可登录,请使用您的专属网址
+								// 		this.lang.Accountcannot
+								// 	);
+								// }
+								// 该账号须使用“组织号登陆”
 								this.$message.error(this.lang.accountmustOrg);
 								this.loginType = "orgL";
 								return resolve(2);
@@ -833,7 +883,7 @@ export default {
 					});
 			});
 		},
-		//获取组织或学校的数据
+		//获取组织或学校的数据,渲染非荔园学校页面
 		getOrdOidData() {
 			let params = [
 				{
@@ -857,6 +907,7 @@ export default {
 		},
 		wechatLogin() {
 			this.loginType = "weChat";
+			this.org = "";
 			setTimeout(() => {
 				const randomState = Math.random().toString(36).substring(2); // 生成随机状态
 				// eslint-disable-next-line no-undef
@@ -918,32 +969,31 @@ 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) &&
-							!_list.includes(
-								this.OrgOptions.find((i) => i.Uorg == this.org).id
-							)
-						) {
+						if (!_list.includes(this.OrgOptions[0].id)) {
 							this.$message.error(this.lang.Accountcannot);
 							this.wechatLogin();
 							await loginOut();
 							await this.logout();
-							return
+							return;
 						}
 					} else {
 						let mergedList = this.allowOrgList.reduce((acc, curr) => {
 							return [...acc, ...curr.list];
 						}, []);
+						// if (
+						// 	this.OrgOptions.find((i) => i.Uorg == this.org) &&
+						// 	!_list.includes(
+						// 		this.OrgOptions.find((i) => i.Uorg == this.org).id
+						// 	)
+						// ) {
 						if (
-							mergedList.includes(
-								this.OrgOptions.find((i) => i.Uorg == this.org).id
-							)
+							mergedList.includes(this.OrgOptions[0].id)
 						) {
 							this.$message.error(this.lang.Accountcannot);
 							this.wechatLogin();
 							await loginOut();
 							await this.logout();
-							return 
+							return;
 						}
 					}
 					let userjson = await getUser({ userid: _data.userid });
@@ -986,7 +1036,7 @@ export default {
 					this.loading = false;
 				})
 				.catch((err) => {
-					console.log('错误信息',err.response);
+					console.log("错误信息", err.response);
 					if (err && err.response && err.response.status === 401) {
 						this.loginType = "bind";
 					}
@@ -1003,7 +1053,11 @@ export default {
 		// 随机码登录
 		nextSteps() {
 			if (!this.SuffixData) {
-				this.$message.error(this.prefixL == 'liyuan_' ? this.lang.choosecampus : this.lang.enterrandomcode);
+				this.$message.error(
+					this.prefixL == "liyuan_"
+						? this.lang.choosecampus
+						: this.lang.enterrandomcode
+				);
 				return;
 			}
 			let reg = /^\d+$/;
@@ -1085,40 +1139,43 @@ export default {
 					geetest_validate: "",
 					geetest_seccode: "",
 					openid: this.stuInfoCode.userid,
-					edu: true
+					edu: true,
 				};
 				axios.defaults.withCredentials = true;
 				axios
 					.post(this.userRequest, qs.stringify(params))
 					.then(async (res) => {
-							console.log("res", res);
-							this.loading = false;
+						console.log("res", res);
+						this.loading = false;
 
-							let _data = res.data[0][0];
-							let userjson = await getUser({ userid: _data.userid });
+						let _data = res.data[0][0];
+						let userjson = await getUser({ userid: _data.userid });
 
-							console.log("userjson", userjson);
-							if (_data.active === 1) {
-								window.localStorage["identity"] = JSON.stringify(_data.identity);
-								
-								window.topU.U.UF.Cookie.set("cocoroboLoginType=2");
-								window.topU
-									? (window.topU.US.userInfo = _data)
-									: (window.parent.US.userInfo = _data);
-								await this.login();
-								this.$message.success(this.lang.Loginsuccessful);
-								
-								this.$router.push({ path: this.redirect || "/", query: { courseId: this.courseId } });
-								this.addOp3(
-									"1",
-									"",
-									{ type: this.prefixL + "stuCode_login" },
-									"success",
-									this.stuInfoCode.userid
-								);
-							} else {
-								this.$message.error(this.lang.Loginfailed);
-							}
+						console.log("userjson", userjson);
+						if (_data.active === 1) {
+							window.localStorage["identity"] = JSON.stringify(_data.identity);
+
+							window.topU.U.UF.Cookie.set("cocoroboLoginType=2");
+							window.topU
+								? (window.topU.US.userInfo = _data)
+								: (window.parent.US.userInfo = _data);
+							await this.login();
+							this.$message.success(this.lang.Loginsuccessful);
+
+							this.$router.push({
+								path: this.redirect || "/",
+								query: { courseId: this.courseId },
+							});
+							this.addOp3(
+								"1",
+								"",
+								{ type: this.prefixL + "stuCode_login" },
+								"success",
+								this.stuInfoCode.userid
+							);
+						} else {
+							this.$message.error(this.lang.Loginfailed);
+						}
 					})
 					.catch((err) => {
 						this.loading = false;
@@ -1132,7 +1189,7 @@ export default {
 		// 获取荔园校区数据
 		getData() {
 			this.loginType = "code";
-			this.SuffixData = '';
+			this.SuffixData = "";
 			this.Codeloading = true;
 			let params = [
 				{
@@ -1161,11 +1218,11 @@ export default {
 		let _this = this;
 		window.addEventListener("message", function (e) {
 			// 监听 message 事件
-			console.log('longin',e);
+			console.log("longin", e);
 			if (e.data && e.data.method == "getOpenId") {
-				console.log('e',e);
-				console.log('e.data.code',e.data.code);
-				console.log('_this.loginType',_this.loginType);
+				console.log("e", e);
+				console.log("e.data.code", e.data.code);
+				console.log("_this.loginType", _this.loginType);
 
 				if (e.data.code == 200) {
 					_this.getOpenId(e.data.data.openid);
@@ -1177,7 +1234,7 @@ export default {
 		});
 		this.getLoading();
 		this.getOrdOidData();
-	}
+	},
 };
 </script>
 <style scoped>
@@ -1215,7 +1272,7 @@ export default {
 	align-items: center;
 	position: relative;
 }
-.Version{
+.Version {
 	background: #f0f4fa;
 	/* border-radius: 50%; */
 	border-radius: 50px 50px 50px 50px;