| | |
| | | private final IUserService userService; |
| | | |
| | | /** |
| | | * 二维码生成 |
| | | * 二维码生成-字节流 |
| | | * @param securityNumber 保安证编号 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getQrCode") |
| | | public ResponseEntity<byte[]> getQrCode(String securityNumber){ |
| | | String url = "http://s16s652780.51mypc.cn/securityInfo/securityInfo.html"; |
| | | // String url = "http://s16s652780.51mypc.cn/securityInfo/securityInfo.html"; |
| | | String url = "http://223.82.109.183:2080/securityInfo.html"; |
| | | if (null!=securityNumber) { |
| | | String content = url + "?securityNumber=" + securityNumber; |
| | | // "&realName=" + one.getRealName() + |
| | |
| | | |
| | | |
| | | /** |
| | | * 二维码生成 |
| | | * 二维码生成base64 |
| | | * @param securityNumber 保安证编号 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getQrCodeBase64") |
| | | public String getQrCodeBase64(String securityNumber) throws Exception{ |
| | | String url = "http://s16s652780.51mypc.cn/securityInfo/securityInfo.html"; |
| | | // String url = "http://s16s652780.51mypc.cn/securityInfo/securityInfo.html"; |
| | | String url = "http://223.82.109.183:2080/securityInfo.html"; |
| | | if (null!=securityNumber) { |
| | | String content = url + "?securityNumber=" + securityNumber; |
| | | String encoded = URLEncoder.encode(securityNumber,"UTF-8"); |
| | | |
| | | String content = url + "?securityNumber=" + encoded; |
| | | |
| | | byte[] qrCodeImage = QRCodeUtil.getQRCodeImage(content, 350, 350); |
| | | String encode = new BASE64Encoder().encode(qrCodeImage); |
| | | return "data:image/png;base64,"+encode; |