Compare commits

..

No commits in common. '62628df4e97941ff734c078189b4f88dc6ab91fa' and 'fe0a559802222d3674fee7ea8a05c94dd54606ae' have entirely different histories.

  1. 2
      jeecgboot-vue3-master/index.html
  2. 10
      jeecgboot-vue3-master/src/App.vue
  3. 4
      jeecgboot-vue3-master/src/components/Application/src/AppLogo.vue
  4. 9
      jeecgboot-vue3-master/src/hooks/setting/index.ts
  5. 35
      jeecgboot-vue3-master/src/store/modules/useSettingStore.ts

@ -10,7 +10,7 @@
/> />
<title><%= title %></title> <title><%= title %></title>
<!-- <link rel="icon" href="/logo.png" /> --> <link rel="icon" href="/logo.png" />
<!-- 全局配置 --> <!-- 全局配置 -->
<script> <script>
window._CONFIG = {}; window._CONFIG = {};

@ -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';

@ -5,7 +5,7 @@
<template> <template>
<div class="anticon" :class="getAppLogoClass" @click="goHome"> <div class="anticon" :class="getAppLogoClass" @click="goHome">
<!-- <img src="../../../assets/images/logo.png" />--> <!-- <img src="../../../assets/images/logo.png" />-->
<img :src="setting.logo" /> <img src="../../../assets/images/comp/appLogo.png" />
<div class="ml-2 truncate md:opacity-100" :class="getTitleClass" v-show="showTitle"> <div class="ml-2 truncate md:opacity-100" :class="getTitleClass" v-show="showTitle">
{{ title }} {{ title }}
</div> </div>
@ -19,8 +19,6 @@
import { useDesign } from '/@/hooks/web/useDesign'; import { useDesign } from '/@/hooks/web/useDesign';
import { PageEnum } from '/@/enums/pageEnum'; import { PageEnum } from '/@/enums/pageEnum';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import { useSettingStore } from '/@/store/modules/useSettingStore';
const { setting } = useSettingStore();
const props = defineProps({ const props = defineProps({
/** /**

@ -2,12 +2,6 @@ import type { GlobConfig } from '/#/config';
import { getAppEnvConfig } from '/@/utils/env'; import { getAppEnvConfig } from '/@/utils/env';
import { useSettingStore } from '/@/store/modules/useSettingStore';
import { store } from '/@/store';
const settingStore = useSettingStore(store);
export const useGlobSetting = (): Readonly<GlobConfig> => { export const useGlobSetting = (): Readonly<GlobConfig> => {
const { const {
VITE_GLOB_APP_TITLE, VITE_GLOB_APP_TITLE,
@ -28,7 +22,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
} }
// Take global configuration // Take global configuration
const glob: GlobConfig = { const glob: Readonly<GlobConfig> = {
title: VITE_GLOB_APP_TITLE, title: VITE_GLOB_APP_TITLE,
domainUrl: VITE_GLOB_DOMAIN_URL, domainUrl: VITE_GLOB_DOMAIN_URL,
apiUrl: VITE_GLOB_API_URL, apiUrl: VITE_GLOB_API_URL,
@ -41,6 +35,5 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
viewUrl: VITE_GLOB_ONLINE_VIEW_URL, viewUrl: VITE_GLOB_ONLINE_VIEW_URL,
}; };
window._CONFIG['domianURL'] = VITE_GLOB_DOMAIN_URL; window._CONFIG['domianURL'] = VITE_GLOB_DOMAIN_URL;
Object.defineProperty(glob, 'title', settingStore.getDescriptor('name'));
return glob as Readonly<GlobConfig>; return glob as Readonly<GlobConfig>;
}; };

@ -1,35 +0,0 @@
import { defineStore } from 'pinia';
import axios from 'axios';
const setting = {
id: '',
createBy: '',
createTime: '',
updateBy: '',
updateTime: '',
sysOrgCode: '',
name: '',
logo: '',
newsPage: '',
recordNumber: '',
copyright: '',
certificate: '',
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);
setting.logo = import.meta.env.VITE_GLOB_DOMAIN_URL + '/' + setting.logo;
}
export const useSettingStore = defineStore('setting', {
state: () => {
getSetting(setting);
const getDescriptor = (prop: string) => {
return { get: () => setting[prop] };
};
return { setting, getDescriptor };
},
});
Loading…
Cancel
Save