index.js 611 B

1234567891011121314151617
  1. import { xmLocalStorage } from '@/common/services/storage-service'
  2. const hasHomeLogo = xmLocalStorage.getItem('homeLogo')
  3. const oldLogoTheme = document.getElementById('logo-style')
  4. const style = document.createElement('style')
  5. style.id = 'logo-style'
  6. style.type = 'text/css'
  7. style.innerText = `.title_sd-header_common{background: url(${
  8. hasHomeLogo
  9. ? 'api/oa/v1/oalogoconfig/we-open-api/downloadBackGrounImg?name=homeLogo'
  10. : require('@custom/images/logo.png')
  11. }) no-repeat center center !important}`
  12. if (oldLogoTheme) {
  13. document.head.removeChild(oldLogoTheme)
  14. }
  15. document.head.appendChild(style)