Merge branch 'main-44133d0c9' into pms-dev

This commit is contained in:
root 2024-08-04 04:22:49 +08:00
commit 33f38f42cc
1 changed files with 5 additions and 1 deletions

View File

@ -63,7 +63,11 @@ const vueFilePathPlugin = (outputFilePath) => {
return html.replace( return html.replace(
'</body>', '</body>',
`<script> `<script>
const isWindowActive = () => !document.hidden;
window.addEventListener('beforeunload', function () { window.addEventListener('beforeunload', function () {
if (!isWindowActive()) {
return;
}
fetch('/generate-path-name-map'); fetch('/generate-path-name-map');
}); });
</script></body>` </script></body>`
@ -97,4 +101,4 @@ const vueFilePathPlugin = (outputFilePath) => {
}; };
} }
export default vueFilePathPlugin export default vueFilePathPlugin