recommend user to use Google Chrome

This commit is contained in:
RockYang 2024-09-15 10:25:50 +08:00
parent 829fb879a6
commit 603bfa7def
2 changed files with 10 additions and 0 deletions

View File

@ -8,6 +8,8 @@
import {ElConfigProvider} from 'element-plus';
import {onMounted} from "vue";
import {getSystemInfo} from "@/store/cache";
import {isChrome} from "@/utils/libs";
import {showMessageInfo} from "@/utils/dialog";
const debounce = (fn, delay) => {
let timer
@ -36,6 +38,9 @@ onMounted(() => {
link.href = res.data.logo
document.head.appendChild(link)
})
if (!isChrome()) {
showMessageInfo("检测到您使用的浏览器不是 Chrome可能会导致部分功能无法正常使用建议使用 Chrome 浏览器。")
}
})
</script>

View File

@ -232,4 +232,9 @@ export const replaceImg =(img) => {
}
return img
}
export function isChrome() {
const userAgent = navigator.userAgent.toLowerCase();
return /chrome/.test(userAgent) && !/edg/.test(userAgent);
}