import { loginCode, loginForm } from './index.compositions'
import { getGifCaptchaApi } from 'mocp/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)
    }
}
