Compare commits

...

3 Commits

  1. 16
      jeecgboot-vue3-master/index.html
  2. 10
      jeecgboot-vue3-master/src/App.vue
  3. 5
      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';

@ -16,7 +16,6 @@ const setting = {
composition: '',
};
async function getSetting(setting) {
console.count('请求---');
const res = await axios({ method: 'post', url: `${import.meta.env.VITE_GLOB_DOMAIN_URL}/sysconfiguration/sysConfiguration/findconfig` });
Object.assign(setting, res.data.result);
@ -25,11 +24,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