Kaynağa Gözat

修改随机码登录

11wqe1 4 hafta önce
ebeveyn
işleme
26382e1f47
1 değiştirilmiş dosya ile 14 ekleme ve 15 silme
  1. 14 15
      src/views/login/loginPage.vue

+ 14 - 15
src/views/login/loginPage.vue

@@ -25,7 +25,7 @@
 							</div>
 						</div>
 						<div v-if="steps == 2" style="cursor: pointer" @click="steps = 1">
-							<i style="font-size: 30px;" class="el-icon-back"></i>
+							<i style="font-size: 30px" class="el-icon-back"></i>
 						</div>
 					</div>
 				</div>
@@ -255,7 +255,7 @@
 							@click="(loginType = 'code')"
 							v-show="false"
 						>
-						<!-- v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)" -->
+							<!-- v-if="['default', 'weChat', 'orgL', 'code'].includes(loginType)" -->
 							<el-tooltip effect="dark" content="随机码登录" placement="bottom">
 								<img
 									:src="
@@ -1030,31 +1030,30 @@ export default {
 					}
 				);
 
-				let userjson = await getUser({ userid: this.stuInfoCode.userid });
+				// let userjson = await getUser({ userid: this.stuInfoCode.userid });
 
-				console.log("userjson", userjson);
+				// 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;
+				window.topU.postMessage(
+					{
+						tools: "inviteLogin",
+						userid: this.stuInfoCode.userid,
+					},
+					"*"
+				);
 
 				this.$message.success("登录成功");
-
-				await this.login();
-
+				sessionStorage.setItem("lytype", "courseDetail");
 				// this.$router.push({ path: this.redirect || "/" });
 
-				this.$router.push({ path: '/', query: { courseId: this.courseId } });
+				this.$router.push({ path: "/", query: { courseId: this.courseId } });
 
 				this.addOp3(
 					"1",
 					"",
 					{ type: this.prefixL + "stuCode_login" },
 					"success",
-					userjson.userid
+					this.stuInfoCode.userid
 				);
 			} catch (error) {
 				console.error("登录过程中出错:", error);