Merge branch 'gst4base' of http://182.92.169.222:3000/zhc077/hnjd_comp into gst4base

gst4base
JayChou 2 months ago
commit 6647f3a545
  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">
<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';

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