useAdAuthorize.ts 659 B

1234567891011121314151617181920212223242526272829
  1. import { useAjax } from '@/Hook/useAjax'
  2. import { getAdAccountApi } from '@/services/launchAdq/adAuthorize'
  3. import { getGroupListApi } from '@/services/launchAdq/subgroup'
  4. export default function useAdAuthorize() {
  5. const getAdAccount = useAjax(() => getAdAccountApi(), { formatResult: true })
  6. /** 所有分组列表 */
  7. const getGroupList = useAjax(() => getGroupListApi())
  8. /** 初始话 */
  9. const groupListInit = () => {
  10. getGroupList.run()
  11. }
  12. const groupRefresh = () => {
  13. getGroupList.refresh()
  14. }
  15. return {
  16. getAdAccount,
  17. getGroupList,
  18. groupListInit,
  19. groupRefresh
  20. }
  21. }