import services from '@/services';
import { useRequest } from 'ahooks';
import { useState } from 'react';
/**
 * 获取区域id
 */
export default () => {
  const [areaId, setAreaId] = useState<string>('');
  useRequest(services.CommQuery.getUserDataPermission, {
    onSuccess: (res) => {
      const data = res?.data?.areaGrid?.[0];
      setAreaId(data || '1');
    },
  });

  return {
    areaId,
  };
};
