|
@@ -2,7 +2,7 @@
|
|
<div class="home">
|
|
<div class="home">
|
|
|
|
|
|
<header class="header">
|
|
<header class="header">
|
|
- <div class="school-logo"><img :src="this.logoPath" alt="school logo" />
|
|
|
|
|
|
+ <div class="school-logo"><img class="logo-size" :src="this.logoPath" alt="school logo" />
|
|
</div>
|
|
</div>
|
|
<a class="close" style="border-bottom-left-radius: 6px;">关闭</a>
|
|
<a class="close" style="border-bottom-left-radius: 6px;">关闭</a>
|
|
</header>
|
|
</header>
|
|
@@ -51,14 +51,13 @@
|
|
/**
|
|
/**
|
|
* 在任何组件需要强制退出,做以下步骤
|
|
* 在任何组件需要强制退出,做以下步骤
|
|
* 1. this.$Message.info()
|
|
* 1. this.$Message.info()
|
|
- * 2. this.$router.push("/login");
|
|
|
|
|
|
+ * 2. this.$router.push("/login"+domain);
|
|
* 因为在/login里会删除localStorage的token,而在router.beforeEach会检查是否有token,达到退出的目的。
|
|
* 因为在/login里会删除localStorage的token,而在router.beforeEach会检查是否有token,达到退出的目的。
|
|
*/
|
|
*/
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- logoPath:
|
|
|
|
- "/api/ecs_core/org/logo?domain=" + process.env.VUE_APP_LOGIN_DOMAIN,
|
|
|
|
|
|
+ logoPath: "/api/ecs_core/org/logo?domain=" + this.$route.params.domain,
|
|
productName: "远程教育网络考试",
|
|
productName: "远程教育网络考试",
|
|
loginType: "STUDENT_CODE",
|
|
loginType: "STUDENT_CODE",
|
|
errorInfo: "",
|
|
errorInfo: "",
|
|
@@ -87,8 +86,7 @@ export default {
|
|
async created() {
|
|
async created() {
|
|
try {
|
|
try {
|
|
const res = await this.$http.get(
|
|
const res = await this.$http.get(
|
|
- "/api/ecs_core/org/getRootOrgByCode?code=" +
|
|
|
|
- process.env.VUE_APP_LOGIN_DOMAIN
|
|
|
|
|
|
+ "/api/ecs_core/org/getRootOrgByCode?code=" + this.$route.params.domain
|
|
);
|
|
);
|
|
const productName = res.data.examSysName;
|
|
const productName = res.data.examSysName;
|
|
this.productName = productName || "远程教育网络考试";
|
|
this.productName = productName || "远程教育网络考试";
|
|
@@ -106,14 +104,12 @@ export default {
|
|
} else {
|
|
} else {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- this.loginForm["domain"] = this.$route.query.domain || "";
|
|
|
|
let repPara = this.loginForm;
|
|
let repPara = this.loginForm;
|
|
try {
|
|
try {
|
|
const response = await this.$http.post("/api/ecs_core/auth/login", {
|
|
const response = await this.$http.post("/api/ecs_core/auth/login", {
|
|
...repPara,
|
|
...repPara,
|
|
accountType: this.loginType,
|
|
accountType: this.loginType,
|
|
- // FIXME: 根据域名来确定domain
|
|
|
|
- domain: process.env.VUE_APP_LOGIN_DOMAIN
|
|
|
|
|
|
+ domain: this.$route.params.domain
|
|
});
|
|
});
|
|
let data = response.data;
|
|
let data = response.data;
|
|
if (data.token) {
|
|
if (data.token) {
|
|
@@ -121,6 +117,7 @@ export default {
|
|
//缓存用户信息
|
|
//缓存用户信息
|
|
window.localStorage.setItem("token", data.token);
|
|
window.localStorage.setItem("token", data.token);
|
|
window.localStorage.setItem("key", data.key);
|
|
window.localStorage.setItem("key", data.key);
|
|
|
|
+ window.localStorage.setItem("domain", this.$route.params.domain);
|
|
|
|
|
|
const student = (await this.$http.get(
|
|
const student = (await this.$http.get(
|
|
"/api/ecs_core/student/getStudentInfoBySession"
|
|
"/api/ecs_core/student/getStudentInfoBySession"
|
|
@@ -149,6 +146,12 @@ export default {
|
|
margin-left: -300px;
|
|
margin-left: -300px;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.logo-size {
|
|
|
|
+ height: 100px;
|
|
|
|
+ width: 300px;
|
|
|
|
+ object-fit: cover;
|
|
|
|
+}
|
|
|
|
+
|
|
.header {
|
|
.header {
|
|
min-height: 120px;
|
|
min-height: 120px;
|
|
display: grid;
|
|
display: grid;
|