gst4base
significative 2 months ago
parent 1b56548151
commit 58788b3e53
  1. 16
      jeecgboot-vue3-master/index.html
  2. 10
      jeecgboot-vue3-master/src/App.vue
  3. 4
      jeecgboot-vue3-master/src/store/modules/useSettingStore.ts

@ -161,7 +161,7 @@
<div class="app-loading">
<div class="app-loading-wrap">
<!-- <img src="/resource/img/logo.png" class="app-loading-logo" alt="Logo" />-->
<img src="/resource/img/comp/appLogo.png" class="app-loading-logo" alt="Logo" />
<img src="/resource/img/comp/appLogo.png" class="app-loading-logo" id="change-logo" alt="Logo" />
<div class="app-loading-dots">
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
</div>
@ -169,6 +169,20 @@
</div>
</div>
</div>
<script type="module">
import { useSettingStore } from './src/store/modules/useSettingStore';
import { store } from './src/store/index';
const { setting , isGot } = useSettingStore(store);
isGot.then(res=>{
const link = document.createElement('link');
link.rel = 'icon';
link.href = setting.logo;
const head = document.head || document.getElementsByTagName('head')[0];
head.appendChild(link);
const changelogo = document.querySelector('#change-logo');
if(changelogo) changelogo.src = setting.logo;
});
</script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

@ -11,16 +11,6 @@
import { AppProvider } from '/@/components/Application';
import { useTitle } from '/@/hooks/web/useTitle';
import { useLocale } from '/@/locales/useLocale';
import { useSettingStore } from '/@/store/modules/useSettingStore';
const { setting } = useSettingStore();
(function () {
const link = document.createElement('link');
link.rel = 'icon';
link.href = setting.logo;
const head = document.head || document.getElementsByTagName('head')[0];
head.appendChild(link);
})();
//
import 'dayjs/locale/zh-cn';

@ -25,11 +25,11 @@ async function getSetting(setting) {
export const useSettingStore = defineStore('setting', {
state: () => {
getSetting(setting);
const isGot = getSetting(setting);
const getDescriptor = (prop: string) => {
return { get: () => setting[prop] };
};
return { setting, getDescriptor };
return { setting, getDescriptor, isGot };
},
});

Loading…
Cancel
Save