|
@@ -66,7 +66,6 @@
|
|
v-model="loginForm.accountValue"
|
|
v-model="loginForm.accountValue"
|
|
type="text"
|
|
type="text"
|
|
size="large"
|
|
size="large"
|
|
- @on-blur="loginForm.accountValue"
|
|
|
|
>
|
|
>
|
|
<i-icon slot="prepend" type="ios-person"></i-icon>
|
|
<i-icon slot="prepend" type="ios-person"></i-icon>
|
|
</i-input>
|
|
</i-input>
|
|
@@ -77,16 +76,22 @@
|
|
type="password"
|
|
type="password"
|
|
size="large"
|
|
size="large"
|
|
@on-enter="loginForuser"
|
|
@on-enter="loginForuser"
|
|
- @on-blur="loginForm.accountValue"
|
|
|
|
>
|
|
>
|
|
<i-icon slot="prepend" type="ios-lock"></i-icon>
|
|
<i-icon slot="prepend" type="ios-lock"></i-icon>
|
|
</i-input>
|
|
</i-input>
|
|
</i-form-item>
|
|
</i-form-item>
|
|
|
|
|
|
|
|
+ <i-form-item
|
|
|
|
+ class="form-item-style"
|
|
|
|
+ style="height: 40px; margin-top: 0px;"
|
|
|
|
+ >
|
|
|
|
+ <GeeTest @on-load="handleGtResult" />
|
|
|
|
+ </i-form-item>
|
|
|
|
+
|
|
<i-form-item style="position: relative;">
|
|
<i-form-item style="position: relative;">
|
|
<div
|
|
<div
|
|
v-if="errorInfo !== ''"
|
|
v-if="errorInfo !== ''"
|
|
- style="position: absolute; top: -37px; width: 100%;"
|
|
|
|
|
|
+ style="position: absolute; top: -25px; width: 100%;"
|
|
>
|
|
>
|
|
<i-alert type="error" show-icon>{{ errorInfo }}</i-alert>
|
|
<i-alert type="error" show-icon>{{ errorInfo }}</i-alert>
|
|
</div>
|
|
</div>
|
|
@@ -135,6 +140,7 @@ import {
|
|
createEncryptLog,
|
|
createEncryptLog,
|
|
} from "@/utils/logger";
|
|
} from "@/utils/logger";
|
|
import { isElectron } from "@/utils/util";
|
|
import { isElectron } from "@/utils/util";
|
|
|
|
+import GeeTest from "./GeeTest";
|
|
|
|
|
|
// 检测devtools. 仅在chrome 72+ 有效。
|
|
// 检测devtools. 仅在chrome 72+ 有效。
|
|
let element = new Image();
|
|
let element = new Image();
|
|
@@ -164,6 +170,7 @@ export default {
|
|
name: "Login",
|
|
name: "Login",
|
|
components: {
|
|
components: {
|
|
DevTools,
|
|
DevTools,
|
|
|
|
+ GeeTest,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -191,6 +198,7 @@ export default {
|
|
},
|
|
},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
|
|
+ captchaObj: null,
|
|
loginBtnLoading: false,
|
|
loginBtnLoading: false,
|
|
disableLoginBtnBecauseRemoteApp: true,
|
|
disableLoginBtnBecauseRemoteApp: true,
|
|
disableLoginBtnBecauseVCam: true,
|
|
disableLoginBtnBecauseVCam: true,
|
|
@@ -470,6 +478,10 @@ export default {
|
|
this.loginBtnLoading = true;
|
|
this.loginBtnLoading = true;
|
|
const before = Date.now();
|
|
const before = Date.now();
|
|
|
|
|
|
|
|
+ if (!this.captchaObj.getValidate()) {
|
|
|
|
+ this.$Message.error("请完成验证");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
try {
|
|
try {
|
|
await this.login();
|
|
await this.login();
|
|
} finally {
|
|
} finally {
|
|
@@ -510,15 +522,22 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
let repPara = this.loginForm;
|
|
let repPara = this.loginForm;
|
|
|
|
+ const geeForm = document.querySelector(".geetest_form").children;
|
|
// 以下网络请求失败,直接报网络异常错误
|
|
// 以下网络请求失败,直接报网络异常错误
|
|
loginResponse = await this.$http.post(
|
|
loginResponse = await this.$http.post(
|
|
- "/api/ecs_core/verifyCode/login",
|
|
|
|
|
|
+ "/api/ecs_core/verifyCode/gt/login",
|
|
{
|
|
{
|
|
...repPara,
|
|
...repPara,
|
|
accountType: this.loginType,
|
|
accountType: this.loginType,
|
|
domain: this.schoolDomain,
|
|
domain: this.schoolDomain,
|
|
rootOrgId: this.QECSConfig.ROOT_ORG_ID,
|
|
rootOrgId: this.QECSConfig.ROOT_ORG_ID,
|
|
alwaysOK: true,
|
|
alwaysOK: true,
|
|
|
|
+ // geetest
|
|
|
|
+ user_id: localStorage.getItem("uuidForEcs"),
|
|
|
|
+ client_type: "Web",
|
|
|
|
+ challenge: geeForm[0].value,
|
|
|
|
+ validate: geeForm[1].value,
|
|
|
|
+ seccode: geeForm[2].value,
|
|
}
|
|
}
|
|
);
|
|
);
|
|
} else {
|
|
} else {
|
|
@@ -630,6 +649,7 @@ export default {
|
|
window._hmt.push(["_trackEvent", "登录页面", "登录失败", data.desc]);
|
|
window._hmt.push(["_trackEvent", "登录页面", "登录失败", data.desc]);
|
|
createLog({ currentPage: "登录页面", action: "登录失败" });
|
|
createLog({ currentPage: "登录页面", action: "登录失败" });
|
|
this.errorInfo = data.desc;
|
|
this.errorInfo = data.desc;
|
|
|
|
+ this.captchaObj.reset();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async checkNewVersion() {
|
|
async checkNewVersion() {
|
|
@@ -1026,6 +1046,10 @@ export default {
|
|
this.logout();
|
|
this.logout();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ handleGtResult(captchaObj) {
|
|
|
|
+ console.log(captchaObj);
|
|
|
|
+ this.captchaObj = captchaObj;
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|