|
@@ -82,6 +82,7 @@
|
|
</i-form-item>
|
|
</i-form-item>
|
|
|
|
|
|
<i-form-item
|
|
<i-form-item
|
|
|
|
+ v-if="isGeeTestEnabled"
|
|
class="form-item-style"
|
|
class="form-item-style"
|
|
style="height: 40px; margin-top: 0px;"
|
|
style="height: 40px; margin-top: 0px;"
|
|
>
|
|
>
|
|
@@ -211,6 +212,7 @@ export default {
|
|
disableLoginBtnBecauseNotAllowedNative: true,
|
|
disableLoginBtnBecauseNotAllowedNative: true,
|
|
newVersionAvailable: false,
|
|
newVersionAvailable: false,
|
|
VUE_APP_GIT_REPO_VERSION: process.env.VUE_APP_GIT_REPO_VERSION,
|
|
VUE_APP_GIT_REPO_VERSION: process.env.VUE_APP_GIT_REPO_VERSION,
|
|
|
|
+ GeeTestConfig: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -265,6 +267,12 @@ export default {
|
|
this.disableLoginBtnBecauseNotAllowedNative
|
|
this.disableLoginBtnBecauseNotAllowedNative
|
|
);
|
|
);
|
|
},
|
|
},
|
|
|
|
+ isGeeTestEnabled() {
|
|
|
|
+ const thisOrg = this.GeeTestConfig[this.QECSConfig.ROOT_ORG_ID];
|
|
|
|
+ const isThisOrgUndefined = thisOrg === undefined;
|
|
|
|
+ const allOrg = this.GeeTestConfig["-1"];
|
|
|
|
+ return isThisOrgUndefined ? allOrg : thisOrg;
|
|
|
|
+ },
|
|
},
|
|
},
|
|
async mounted() {
|
|
async mounted() {
|
|
// this.testServiceWorker();
|
|
// this.testServiceWorker();
|
|
@@ -439,6 +447,7 @@ export default {
|
|
// }
|
|
// }
|
|
|
|
|
|
await this.checkElectronConfig();
|
|
await this.checkElectronConfig();
|
|
|
|
+ await this.checkGeeTestConfig();
|
|
await this.checkVCam();
|
|
await this.checkVCam();
|
|
await this.checkAllowedClient();
|
|
await this.checkAllowedClient();
|
|
|
|
|
|
@@ -483,10 +492,12 @@ export default {
|
|
const before = Date.now();
|
|
const before = Date.now();
|
|
|
|
|
|
// console.log(this.captchaObj.getValidate());
|
|
// console.log(this.captchaObj.getValidate());
|
|
- if (!this.captchaObj || !this.captchaObj.getValidate()) {
|
|
|
|
- this.$Message.error("请完成验证");
|
|
|
|
- this.loginBtnLoading = false;
|
|
|
|
- return;
|
|
|
|
|
|
+ if (this.isGeeTestEnabled) {
|
|
|
|
+ if (!this.captchaObj || !this.captchaObj.getValidate()) {
|
|
|
|
+ this.$Message.error("请完成验证");
|
|
|
|
+ this.loginBtnLoading = false;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
await this.login();
|
|
await this.login();
|
|
@@ -528,8 +539,20 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
let repPara = this.loginForm;
|
|
let repPara = this.loginForm;
|
|
- // const geeForm = document.querySelector(".geetest_form").children;
|
|
|
|
- const geeRes = this.captchaObj.getValidate();
|
|
|
|
|
|
+
|
|
|
|
+ let geeParams = {};
|
|
|
|
+ if (this.isGeeTestEnabled) {
|
|
|
|
+ // const geeForm = document.querySelector(".geetest_form").children;
|
|
|
|
+ const geeRes = this.captchaObj.getValidate();
|
|
|
|
+ geeParams = {
|
|
|
|
+ // geetest
|
|
|
|
+ user_id: localStorage.getItem("uuidForEcs"),
|
|
|
|
+ client_type: "Web",
|
|
|
|
+ challenge: geeRes.geetest_challenge, // geeForm[0].value,
|
|
|
|
+ validate: geeRes.geetest_validate, // geeForm[1].value,
|
|
|
|
+ seccode: geeRes.geetest_seccode, // geeForm[2].value,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
// 以下网络请求失败,直接报网络异常错误
|
|
// 以下网络请求失败,直接报网络异常错误
|
|
loginResponse = await this.$http.post(
|
|
loginResponse = await this.$http.post(
|
|
"/api/ecs_core/verifyCode/gt/login",
|
|
"/api/ecs_core/verifyCode/gt/login",
|
|
@@ -539,12 +562,7 @@ export default {
|
|
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: geeRes.geetest_challenge, // geeForm[0].value,
|
|
|
|
- validate: geeRes.geetest_validate, // geeForm[1].value,
|
|
|
|
- seccode: geeRes.geetest_seccode, // geeForm[2].value,
|
|
|
|
|
|
+ ...geeParams,
|
|
}
|
|
}
|
|
);
|
|
);
|
|
} else {
|
|
} else {
|
|
@@ -634,6 +652,7 @@ export default {
|
|
// (JSON.parse(localStorage.getItem("userIds")) || []).length > 5;
|
|
// (JSON.parse(localStorage.getItem("userIds")) || []).length > 5;
|
|
|
|
|
|
this.$Spin.hide();
|
|
this.$Spin.hide();
|
|
|
|
+ this.$Message.destroy();
|
|
} catch (error) {
|
|
} catch (error) {
|
|
window._hmt.push([
|
|
window._hmt.push([
|
|
"_trackEvent",
|
|
"_trackEvent",
|
|
@@ -749,6 +768,37 @@ export default {
|
|
|
|
|
|
await this.checkRemoteApp();
|
|
await this.checkRemoteApp();
|
|
},
|
|
},
|
|
|
|
+ async checkGeeTestConfig() {
|
|
|
|
+ try {
|
|
|
|
+ const fileSever = VUE_APP_CONFIG_FILE_SEVER_URL;
|
|
|
|
+
|
|
|
|
+ const res = await fetch(
|
|
|
|
+ fileSever +
|
|
|
|
+ "/org_properties/geetestConfig.json" +
|
|
|
|
+ "?" +
|
|
|
|
+ Date.now() +
|
|
|
|
+ Math.random()
|
|
|
|
+ );
|
|
|
|
+ if (res.ok) {
|
|
|
|
+ const json = await res.json();
|
|
|
|
+ this.GeeTestConfig = json;
|
|
|
|
+ } else {
|
|
|
|
+ this.$Message.error({
|
|
|
|
+ content: "获取远程配置文件出错,请重新打开程序!",
|
|
|
|
+ duration: 15,
|
|
|
|
+ closable: true,
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ } catch (e) {
|
|
|
|
+ this.$Message.error({
|
|
|
|
+ content: "获取远程配置文件出错,请重新打开程序!",
|
|
|
|
+ duration: 15,
|
|
|
|
+ closable: true,
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
async checkRemoteApp() {
|
|
async checkRemoteApp() {
|
|
if (!isElectron()) {
|
|
if (!isElectron()) {
|
|
return;
|
|
return;
|