mirror of
https://github.com/veops/cmdb.git
synced 2025-08-09 19:40:40 +08:00
Modify code organization
This commit is contained in:
19
cmdb-ui/src/utils/domUtil.js
Normal file
19
cmdb-ui/src/utils/domUtil.js
Normal file
@@ -0,0 +1,19 @@
|
||||
export const setDocumentTitle = function (title) {
|
||||
document.title = title
|
||||
const ua = navigator.userAgent
|
||||
// eslint-disable-next-line
|
||||
const regex = /\bMicroMessenger\/([\d\.]+)/
|
||||
if (regex.test(ua) && /ip(hone|od|ad)/i.test(ua)) {
|
||||
const i = document.createElement('iframe')
|
||||
i.src = '/favicon.ico'
|
||||
i.style.display = 'none'
|
||||
i.onload = function () {
|
||||
setTimeout(function () {
|
||||
i.remove()
|
||||
}, 9)
|
||||
}
|
||||
document.body.appendChild(i)
|
||||
}
|
||||
}
|
||||
|
||||
export const domTitle = 'CMDB'
|
Reference in New Issue
Block a user