| | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import sun.misc.BASE64Encoder; |
| | | //import sun.misc.BASE64Encoder; |
| | | |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.util.Base64; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | |
| | | if (null!=securityNumber) { |
| | | String content = url + "?securityNumber=" + securityNumber; |
| | | byte[] qrCodeImage = QRCodeUtil.getQRCodeImage(content, 350, 350); |
| | | String encode = new BASE64Encoder().encode(qrCodeImage); |
| | | String encode = Base64.getMimeEncoder().encodeToString(qrCodeImage); |
| | | return "data:image/png;base64,"+encode; |
| | | } |
| | | return null; |