|
@@ -19,7 +19,7 @@ export default {
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { isMobile } from 'billd-utils';
|
|
import { isMobile } from 'billd-utils';
|
|
|
import { GlobalThemeOverrides, NConfigProvider } from 'naive-ui';
|
|
import { GlobalThemeOverrides, NConfigProvider } from 'naive-ui';
|
|
|
-import { onMounted, ref } from 'vue';
|
|
|
|
|
|
|
+import { onMounted, ref, watch } from 'vue';
|
|
|
import { useRoute } from 'vue-router';
|
|
import { useRoute } from 'vue-router';
|
|
|
|
|
|
|
|
import { fetchSettingsList } from '@/api/settings';
|
|
import { fetchSettingsList } from '@/api/settings';
|
|
@@ -32,6 +32,9 @@ import { getHostnameUrl } from '@/utils';
|
|
|
import { getLastBuildDate, setLastBuildDate } from '@/utils/localStorage/app';
|
|
import { getLastBuildDate, setLastBuildDate } from '@/utils/localStorage/app';
|
|
|
import { getToken } from '@/utils/localStorage/user';
|
|
import { getToken } from '@/utils/localStorage/user';
|
|
|
|
|
|
|
|
|
|
+import { fetchGlobalMsgMyList } from './api/globalMsg';
|
|
|
|
|
+import { useTip } from './hooks/use-tip';
|
|
|
|
|
+
|
|
|
const { checkUpdate } = useCheckUpdate();
|
|
const { checkUpdate } = useCheckUpdate();
|
|
|
const cacheStore = usePiniaCacheStore();
|
|
const cacheStore = usePiniaCacheStore();
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
@@ -47,6 +50,18 @@ const themeOverrides: GlobalThemeOverrides = {
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+watch(
|
|
|
|
|
+ () => userStore.userInfo,
|
|
|
|
|
+ (newval) => {
|
|
|
|
|
+ if (newval) {
|
|
|
|
|
+ handleGlobalMsgMyList();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ immediate: true,
|
|
|
|
|
+ }
|
|
|
|
|
+);
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
initSettings();
|
|
initSettings();
|
|
|
checkUpdate({
|
|
checkUpdate({
|
|
@@ -77,6 +92,20 @@ onMounted(() => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+async function handleGlobalMsgMyList() {
|
|
|
|
|
+ const res = await fetchGlobalMsgMyList({});
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ const data = res.data.rows[0];
|
|
|
|
|
+ if (data) {
|
|
|
|
|
+ useTip({
|
|
|
|
|
+ content: data.content!,
|
|
|
|
|
+ hiddenCancel: true,
|
|
|
|
|
+ hiddenClose: true,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function initSettings() {
|
|
function initSettings() {
|
|
|
setTimeout(async () => {
|
|
setTimeout(async () => {
|
|
|
if (route.path !== '/') {
|
|
if (route.path !== '/') {
|