|
@@ -15,7 +15,7 @@ import { createEncryptLog, createUserDetailLog } from "@/utils/logger";
|
|
|
import { MD5 } from "@/utils/md5";
|
|
|
import { getScreenShot, isElectron } from "@/utils/nativeMethods";
|
|
|
import ua from "@/utils/ua";
|
|
|
-import { decryptLogin } from "@/utils/utils";
|
|
|
+import { decryptLogin, preloadResource } from "@/utils/utils";
|
|
|
import { CloseCircleOutline, LockClosed, Person } from "@vicons/ionicons5";
|
|
|
import { FormItemInst, FormRules } from "naive-ui";
|
|
|
import { onMounted, watch } from "vue";
|
|
@@ -74,23 +74,15 @@ useExamShellStats();
|
|
|
|
|
|
//#region cache faceapi json
|
|
|
{
|
|
|
- const begin = Date.now();
|
|
|
- void Promise.all([
|
|
|
- fetch(
|
|
|
- FACE_API_MODEL_PATH + "tiny_face_detector_model-weights_manifest.json"
|
|
|
- ),
|
|
|
- fetch(FACE_API_MODEL_PATH + "face_landmark_68_model-weights_manifest.json"),
|
|
|
- fetch(FACE_API_MODEL_PATH + "face_expression_model-weights_manifest.json"),
|
|
|
- ]).then(() => {
|
|
|
- logger({
|
|
|
- cnl: ["console", "local", "server"],
|
|
|
- pgn: "登录页面",
|
|
|
- act: "faceapi json loaded",
|
|
|
- ext: {
|
|
|
- expense: Date.now() - begin,
|
|
|
- },
|
|
|
- });
|
|
|
- });
|
|
|
+ const faceapiUrls = [
|
|
|
+ FACE_API_MODEL_PATH + "tiny_face_detector_model-weights_manifest.json",
|
|
|
+ FACE_API_MODEL_PATH + "face_landmark_68_model-weights_manifest.json",
|
|
|
+ FACE_API_MODEL_PATH + "face_expression_model-weights_manifest.json",
|
|
|
+ ];
|
|
|
+
|
|
|
+ for (const u of faceapiUrls) {
|
|
|
+ preloadResource(u);
|
|
|
+ }
|
|
|
}
|
|
|
//#endregion
|
|
|
|