生成二维码图片通过流写回前台

生成二维码图片通过流写回前台,第1张

生成二维码图片通过流写回前台  后台
 
    @GetMapping("/getQRCode/{id}/{chuanming}/{host}")
    @ResponseBody
    public void generateQRCode(@PathVariable("id") String id, @PathVariable("chuanming") String chuanming, @PathVariable("host") String host,
                               HttpServletResponse response) {
        String qrCodeUrl = host + "/charsming/bordingShip/mobile?id=" + id + "&chuanming=" + chuanming;
        try {
            QrConfig qrConfig = new QrConfig(300, 300);
            QrCodeUtil.generate(qrCodeUrl, qrConfig, "png", response.getOutputStream());
        } catch (IOException e) {
            e.printStackTrace();
        }


    }

js

//二维码
function resetPwd(id,chuanming) {
    var host = window.location.host
    layer.open({
        type: 1,
        title: '船舶二维码',
        maxmin: true,
        shadeClose: false, // 点击遮罩关闭层

        content: ``
    });

}

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5686657.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存