|
|
@@ -4,9 +4,11 @@ import { NaiveProvider } from '@/components/common'
|
|
|
import { useTheme } from '@/hooks/useTheme'
|
|
|
import { useLanguage } from '@/hooks/useLanguage'
|
|
|
import { emitter } from '@/plugins'
|
|
|
-import { onMounted, ref, provide } from 'vue'
|
|
|
+import { onMounted, ref, provide, watch, computed } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { useBasicLayout } from '@/hooks/useBasicLayout'
|
|
|
+import { useCompanyStore } from '@/store'
|
|
|
+import { link } from 'fs'
|
|
|
|
|
|
const { theme, themeOverrides } = useTheme()
|
|
|
const { language } = useLanguage()
|
|
|
@@ -29,6 +31,29 @@ function login() {
|
|
|
}
|
|
|
}
|
|
|
provide('login', login)
|
|
|
+const companyStore = useCompanyStore()
|
|
|
+const company = computed(() => {
|
|
|
+ return companyStore.company
|
|
|
+})
|
|
|
+watch(
|
|
|
+ company,
|
|
|
+ () => {
|
|
|
+ if (company.value.companyName) {
|
|
|
+ document.title = company.value.companyName
|
|
|
+ }
|
|
|
+ if (company.value.logo) {
|
|
|
+ console.log(company.value.logo)
|
|
|
+ let link = document.createElement('link')
|
|
|
+ link.rel = 'icon'
|
|
|
+ link.href = company.value.logo
|
|
|
+ document.head.appendChild(link)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+)
|
|
|
</script>
|
|
|
|
|
|
<template>
|