import MESSAGE_ENUM from '@/uilts/messageCenter/messageEnum'
import messageCenter from "@/uilts/messageCenter";
import { getQueryString } from '@/uilts/help'
const iframeId = getQueryString('iframeId')

const getData = {
  getUserInfoByName({screen_name}, overTime) {
    return new Promise((res, rej) => {
      messageCenter.send({
          info: {
              actionType: MESSAGE_ENUM.IFRAME_GET_TWITTER_USER_INFO,
              iframeId
          },
          data: {
            screen_name
          },
          overTime,
          callback: (data) => {
              res(data);
          },
          failback: (e) => {
              rej(e)
          }
      })
    })
  }
}

export default getData
