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">
<div class="app-loading-wrap"> <div class="app-loading-wrap">
<!-- <img src="/resource/img/logo.png" class="app-loading-logo" alt="Logo" />--> <!-- <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"> <div class="app-loading-dots">
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span> <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
</div> </div>
@ -169,6 +169,20 @@
</div> </div>
</div> </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> <script type="module" src="/src/main.ts"></script>
</body> </body>
</html> </html>

@ -11,16 +11,6 @@
import { AppProvider } from '/@/components/Application'; import { AppProvider } from '/@/components/Application';
import { useTitle } from '/@/hooks/web/useTitle'; import { useTitle } from '/@/hooks/web/useTitle';
import { useLocale } from '/@/locales/useLocale'; 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'; import 'dayjs/locale/zh-cn';

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

Loading…
Cancel
Save