登录图片验证码功能
<img :src="codeUrl" class="images" @click="getImg"alt="">
注: 登录页面图形验证码功能,后端获取图形接口返回图片,从header里面取jdh字段 作为唯一标识;
data 里面 codeUrl:""
getVerifyCode().then(res=>{ Cookies.set('jdh', res.headers.jdh) if(res){ return 'data:image/png;base64,' + btoa( new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), '') ) } }).then(data => { this.codeUrl = data; })
愿你笑时风华正茂
浙公网安备 33010602011771号