import defaultSettings from '@/settings';
import { useSettingsStore } from '@/store/modules/settings';

/**
 * 动态修改标题
 */
export const useDynamicTitle = () => {
  const settingsStore = useSettingsStore();
  const baseTitle = settingsStore.websiteSetting.title || import.meta.env.VITE_APP_TITLE;
  if (settingsStore.dynamicTitle) {
    document.title = settingsStore.title + ' - ' + baseTitle;
  } else {
    document.title = baseTitle;
  }
};
