后台
File img = new File(imgPath.toString());
FileInputStream inputStream = new FileInputStream(img);
byte[] bytes = new byte[inputStream.available()];
inputStream.read(bytes, 0, inputStream.available());
前台
this.pay.code_url = 'data:image/jpeg;base64,' + response.code_url