Commit cdebe64f by jack

动态根据域名更换logo

1 parent 840fc479
No preview for this file type
<template>
<div class="home-logo-wrapper">
<img class="home-logo-img" src="@/assets/images/company-logo-sub.png" alt="home-logo" >
<!-- <img class="home-logo-img" src="@/assets/images/company-logo-sub.png" alt="home-logo" > -->
<img class="home-logo-img" :src="smallLogo" alt="home-logo" >
<!-- <img v-show="collapsed" class="home-logo-img home-thumbnail-logo" src="@/assets/images/logo-thumbnail.png" alt="home-logo" > -->
</div>
</template>
......@@ -14,7 +15,8 @@
// collapsed: Boolean
// },
setup () {
const smallLogo = localStorage.getItem('smallLogo');
return {smallLogo}
}
}
</script>
......
......@@ -28,8 +28,8 @@
.header {
width: 100%;
height: 139px !important;
padding: 45px 50px 0 50px;
height: auto !important;
padding: 20px 50px 0 50px;
background-color: #fff;
}
</style>
\ No newline at end of file
<template>
<div class="home-logo-wrapper">
<img class="home-logo-img" src="@/assets/images/company-logo.png" alt="company-logo">
<!-- <img class="home-logo-img" src="@/assets/images/company-logo.png" alt="company-logo"> -->
<img class="home-logo-img" :src="logoPath" alt="company-logo">
<span class="home-logo-title">{{ homeTitle }}</span>
</div>
</template>
......@@ -12,8 +13,8 @@
name: 'Logo',
setup () {
const homeTitle = ref('');
return { homeTitle };
const logoPath = localStorage.getItem('logo')
return { homeTitle,logoPath };
}
}
</script>
......@@ -24,7 +25,8 @@
font-size: 20px;
.home-logo-img {
width: 480px;
//width: 480px;
height:67px;
margin-right: 10px;
}
......
......@@ -4,14 +4,33 @@ import router from './router'
import store from './store'
import elementUI from '@/utils/globalUI/element'
import 'element-plus/lib/theme-chalk/index.css';
import 'element-plus/lib/theme-chalk/index.css'
// import './assets/css/resets.css'
const app = createApp(App);
const app = createApp(App)
const URL =
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
const getConfig = (url = URL + '/e-sheild-portal-config') => {
return new Promise((resolve) => {
const xhr = new XMLHttpRequest()
xhr.onreadystatechange = () => {
if (xhr.readyState === 4 && xhr.status === 200) {
let o = xhr.responseText ? JSON.parse(xhr.responseText) : {}
console.log(o.logo)
localStorage.setItem('logo', o.logo)
localStorage.setItem('title', o.title)
localStorage.setItem('smallLogo',o.smallLogo)
// window.localStorage.setItem(
// 'GLSX_COMMODITY_CENTER_CONFIG',
// xhr.responseText,
// )
}
}
xhr.open('GET', url)
xhr.send()
})
}
app.use(store)
.use(router)
.use(elementUI)
.mount('#app');
getConfig()
\ No newline at end of file
app.use(store).use(router).use(elementUI).mount('#app')
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!