useAppConfig.ts 609 B

1234567891011121314151617181920212223
  1. import { EnumAppConfigKey } from "@/common/enum";
  2. import { useAppStore } from "@/store/appStore";
  3. export const useAppConfig = () => {
  4. const appStore = useAppStore();
  5. /**
  6. * 短信验证码是否开启图形验证
  7. */
  8. const isSmsCaptchaEnable = computed(() => {
  9. return appStore.getAppConfig(EnumAppConfigKey.SMS_CAPTCHA_ENABLE) === 'true';
  10. });
  11. /**
  12. * app 是否开启日志上报
  13. */
  14. const isAppLogReportEnable = computed(() => {
  15. return appStore.getAppConfig(EnumAppConfigKey.APP_LOG_REPORT_ENABLE) === 'true';
  16. });
  17. return {
  18. isSmsCaptchaEnable,
  19. isAppLogReportEnable
  20. }
  21. }