|
@@ -17,7 +17,7 @@ import { getScreenShot, isElectron } from "@/utils/nativeMethods";
|
|
import ua from "@/utils/ua";
|
|
import ua from "@/utils/ua";
|
|
import { decryptLogin, preloadResource } from "@/utils/utils";
|
|
import { decryptLogin, preloadResource } from "@/utils/utils";
|
|
import { CloseCircleOutline, LockClosed, Person } from "@vicons/ionicons5";
|
|
import { CloseCircleOutline, LockClosed, Person } from "@vicons/ionicons5";
|
|
-import { FormItemInst, FormRules } from "naive-ui";
|
|
|
|
|
|
+import { FormItemInst, FormRules, useDialog } from "naive-ui";
|
|
import { onMounted, onUnmounted, watch } from "vue";
|
|
import { onMounted, onUnmounted, watch } from "vue";
|
|
import { useRouter } from "vue-router";
|
|
import { useRouter } from "vue-router";
|
|
import GeeTest from "./GeeTest.vue";
|
|
import GeeTest from "./GeeTest.vue";
|
|
@@ -32,6 +32,8 @@ import { useNewVersion } from "./useNewVersion";
|
|
import { useRemoteAppChecker } from "./useRemoteAppChecker";
|
|
import { useRemoteAppChecker } from "./useRemoteAppChecker";
|
|
import { useVCamChecker } from "./useVCamChecker";
|
|
import { useVCamChecker } from "./useVCamChecker";
|
|
|
|
|
|
|
|
+const dialog = useDialog();
|
|
|
|
+
|
|
const { addTimeout, addInterval } = useTimers();
|
|
const { addTimeout, addInterval } = useTimers();
|
|
|
|
|
|
resetStore();
|
|
resetStore();
|
|
@@ -92,8 +94,26 @@ useExamShellStats();
|
|
|
|
|
|
let isGeeTestEnabled = $ref(false);
|
|
let isGeeTestEnabled = $ref(false);
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
- const conf = await getElectronConfig();
|
|
|
|
- store.QECSConfig = conf;
|
|
|
|
|
|
+ try {
|
|
|
|
+ const conf = await getElectronConfig();
|
|
|
|
+ store.QECSConfig = conf;
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error(error);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (store.QECSConfig && !store.QECSConfig.LOGIN_SUPPORT.includes("NATIVE")) {
|
|
|
|
+ dialog.warning({
|
|
|
|
+ title: "提醒",
|
|
|
|
+ content: "当前版本已禁用,请根据学校通知下载新版考生端程序进行考试!",
|
|
|
|
+ positiveText: "确定",
|
|
|
|
+ maskClosable: false,
|
|
|
|
+ closeOnEsc: false,
|
|
|
|
+ closable: false,
|
|
|
|
+ onPositiveClick: () => {
|
|
|
|
+ closeApp("notSupport");
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
isGeeTestEnabled = await getGeeTestConfig(store.QECSConfig.ROOT_ORG_ID);
|
|
isGeeTestEnabled = await getGeeTestConfig(store.QECSConfig.ROOT_ORG_ID);
|
|
});
|
|
});
|
|
@@ -111,7 +131,7 @@ const backgroundUrl = $computed(
|
|
const productName = $computed(
|
|
const productName = $computed(
|
|
() => QECSConfig.OE_STUDENT_SYS_NAME || "远程教育网络考试"
|
|
() => QECSConfig.OE_STUDENT_SYS_NAME || "远程教育网络考试"
|
|
);
|
|
);
|
|
-const allowLoginType = $computed(() => QECSConfig.LOGIN_TYPE ?? []);
|
|
|
|
|
|
+const allowLoginType = $computed(() => QECSConfig?.LOGIN_TYPE ?? []);
|
|
|
|
|
|
const { newVersionAvailable, checkNewVersion } = useNewVersion();
|
|
const { newVersionAvailable, checkNewVersion } = useNewVersion();
|
|
const { disableLoginBtnBecauseAppVersionChecker } =
|
|
const { disableLoginBtnBecauseAppVersionChecker } =
|
|
@@ -388,12 +408,13 @@ async function afterLogin(loginRes: any) {
|
|
}
|
|
}
|
|
//#endregion
|
|
//#endregion
|
|
|
|
|
|
-function closeApp() {
|
|
|
|
|
|
+function closeApp(type: "exit" | "notSupport" = "exit") {
|
|
|
|
+ const isNotSupport = type === "notSupport";
|
|
logger({
|
|
logger({
|
|
pgu: "AUTO",
|
|
pgu: "AUTO",
|
|
cnl: ["local", "server"],
|
|
cnl: ["local", "server"],
|
|
- key: "退出应用",
|
|
|
|
- act: "点击关闭按钮",
|
|
|
|
|
|
+ key: isNotSupport ? "学生端登录禁用" : "退出应用",
|
|
|
|
+ act: isNotSupport ? "学生端登录禁用,点击确定按钮" : "点击关闭按钮",
|
|
});
|
|
});
|
|
window.close();
|
|
window.close();
|
|
}
|
|
}
|
|
@@ -418,7 +439,7 @@ onUnmounted(() => $message.destroyAll());
|
|
/>
|
|
/>
|
|
<!-- 加上它,在logo加载失败的时候有用 -->
|
|
<!-- 加上它,在logo加载失败的时候有用 -->
|
|
</div>
|
|
</div>
|
|
- <a class="close" @click="closeApp">关闭</a>
|
|
|
|
|
|
+ <a class="close" @click="closeApp()">关闭</a>
|
|
</header>
|
|
</header>
|
|
</div>
|
|
</div>
|
|
|
|
|