import { loginCode, loginForm } from './index.compositions'
import { getGifCaptchaApi } from '@/api/user'

export const getGifCaptcha = async () => {
    const params = {
        username: loginForm.username
    }
    const res = await getGifCaptchaApi(params, { arraybuffer: true })
    if (res) {
        loginCode.value = 'data:image/png;base64,' + uni.arrayBufferToBase64(res)
    }
}