const baseUrl = import.meta.env.VITE_SERVER_BASEURL
export const useCaptcha = () => {
  const t = ref(Date.now())

  const codeUrl = computed(() => {
    return baseUrl + '/api/index/captcha?t=' + t.value
  })
  const refreshCode = () => {
    t.value = Date.now()
  }
  onMounted(() => {
    refreshCode()
  })
  return { codeUrl, t, refreshCode }
}
