import { baseURL } from './http'
import { MessageFu } from './message'

export const XXXXXXXX = (url: string) => {
  if (url) {
    try {
      const input = document.createElement('input')
      const body = document.body
      body.appendChild(input)
      input.value = baseURL + url
      input.select()
      document.execCommand('copy')
      body.removeChild(input)
      MessageFu.success('已复制到剪贴板，请在浏览器中粘贴并下载')
    } catch (error) {
      MessageFu.warning('错误')
    }
  } else MessageFu.warning('暂无文件')
}
