|
@@ -86,7 +86,7 @@
|
|
:loading="loginBtnLoading"
|
|
:loading="loginBtnLoading"
|
|
@click="login"
|
|
@click="login"
|
|
>
|
|
>
|
|
- 登录
|
|
|
|
|
|
+ {{ newVersionAvailable ? "点击更新版本" : "登录" }}
|
|
</i-button>
|
|
</i-button>
|
|
</i-form-item>
|
|
</i-form-item>
|
|
</i-form>
|
|
</i-form>
|
|
@@ -144,6 +144,7 @@ export default {
|
|
},
|
|
},
|
|
disableLoginBtn: true,
|
|
disableLoginBtn: true,
|
|
loginBtnLoading: false,
|
|
loginBtnLoading: 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,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -169,6 +170,12 @@ export default {
|
|
// alread precached
|
|
// alread precached
|
|
// fetch("/models/tiny_face_detector_model-shard1");
|
|
// fetch("/models/tiny_face_detector_model-shard1");
|
|
// fetch("/models/face_landmark_68_model-shard1");
|
|
// fetch("/models/face_landmark_68_model-shard1");
|
|
|
|
+
|
|
|
|
+ this.checkNewVersionInterval = setInterval(() => {
|
|
|
|
+ if (window.__newSWAvailable) {
|
|
|
|
+ this.newVersionAvailable = true;
|
|
|
|
+ }
|
|
|
|
+ }, 1000);
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
if (
|
|
if (
|
|
@@ -293,6 +300,7 @@ export default {
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
clearTimeout(this.loginTimeout);
|
|
clearTimeout(this.loginTimeout);
|
|
|
|
+ clearInterval(this.checkNewVersionInterval);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapMutations(["updateUser", "updateTimeDifference"]),
|
|
...mapMutations(["updateUser", "updateTimeDifference"]),
|