import React , { useState } from 'react' ; import SiteList from '@/component/siteList' ; import { useDidMount } from '@/utils/hooks' ; import { queryMySites } from './service' ; export default ( { history } ) => { const [ data , setData ] = useState ( [ ] ) ; useDidMount ( async ( ) => { const { data : resData } = await queryMySites ( ) ; if ( resData ) { setData ( resData ) ; } } ) ; if ( ! data ) return null ; return ( < SiteList data = { data } history = { history } extracFn = { ( siteId , siteType ) => window . open ( `/sites/submit-site?siteId=${ siteId }&siteType=${ siteType }` ) } extraTitle = "Edit" extraDesc = "编辑该站点" / > ) ; } ;