图形验证码

changeImg(){
            var _that = this
            var num = Math.ceil(Math.random()*10)
            axios.get('learn/get/getValidatePicCode?suiji='+num,{responseType: 'arraybuffer'}).then(function(data) {
                _that.piccode = data.headers.piccode.toLowerCase()
                _that.yzmImg = 'data:image/png;base64,' + btoa(new Uint8Array(data.data).reduce((data, byte) => data + String.fromCharCode(byte), ''))
            });
        },

 

你可能感兴趣的:(随记)