spring-boot & zxing 搭建二維碼服務

使用zxing提供二維碼生成解析服務

搭建一個二維碼的生成 & 解析服務, 使用java web對外提供http調用,返回base64格式的二維碼圖片html

1. 背景&準備

二維碼生成場景實在是太多了,背景都沒啥好說的...java

採用的技術

  • zxing : 實現二維碼的生成 & 解析
  • spring-boot: 提供http服務接口
  • jdk base64 : 對圖片進行base64編碼返回
  • awt : 插入logo

測試case

二維碼生成除了傳入基本的內容以外,有不少能夠配置的參數,好比背景色,前置色,大小,logo,邊框...,顯然這種多參數配置的狀況,咱們會採用Builder設計模式來處理,能夠看下最終的測試代碼以下git

/**
 * 測試二維碼
 */
@Test
public void testGenQrCode() {
    String msg = "https://my.oschina.net/u/566591/blog/1359432";

    try {

        boolean ans = QrCodeGenWrapper.of(msg).asFile("src/test/qrcode/gen.png");
        System.out.println(ans);
    } catch (Exception e) {
        System.out.println("create qrcode error! e: " + e);
        Assert.assertTrue(false);
    }


    //生成紅色的二維碼 300x300, 無邊框
    try {
        boolean ans = QrCodeGenWrapper.of(msg)
                .setW(300)
                .setPreColor(0xffff0000)
                .setBgColor(0xffffffff)
                .setPadding(0)
                .asFile("src/test/qrcode/gen_300x300.png");
        System.out.println(ans);
    } catch (Exception e) {
        System.out.println("create qrcode error! e: " + e);
        Assert.assertTrue(false);
    }


    // 生成帶logo的二維碼
    try {
        String logo = "https://static.oschina.net/uploads/user/283/566591_100.jpeg";
        boolean ans = QrCodeGenWrapper.of(msg)
                .setW(300)
                .setPreColor(0xffff0000)
                .setBgColor(0xffffffff)
                .setPadding(0)
                .setLogo(logo)
                .setLogoStyle(QrCodeOptions.LogoStyle.ROUND)
                .asFile("src/test/qrcode/gen_300x300_logo.png");
        System.out.println(ans);
    } catch (Exception e) {
        System.out.println("create qrcode error! e: " + e);
        Assert.assertTrue(false);
    }


    // 根據本地文件生成待logo的二維碼
    try {
        String logo = "logo.jpg";
        boolean ans = QrCodeGenWrapper.of(msg)
                .setW(300)
                .setPreColor(0xffff0000)
                .setBgColor(0xffffffff)
                .setPadding(0)
                .setLogo(logo)
                .asFile("src/test/qrcode/gen_300x300_logo_v2.png");
        System.out.println(ans);
    } catch (Exception e) {
        System.out.println("create qrcode error! e: " + e);
        Assert.assertTrue(false);
    }
}

2. 設計與實現

1. 配置參數: QrCodeOptions

根據最經常使用的規則,目前提供如下可選的配置項github

  • 輸入內容
  • logo
  • logo的樣式
  • 寬高
  • 前置色,背景色
  • 輸出圖片格式
  • 內容編碼
@Data
public class QrCodeOptions {
    /**
     * 塞入二維碼的信息
     */
    private String msg;


    /**
     * 二維碼中間的logo
     */
    private String logo;


    /**
     * logo的樣式, 目前支持圓角+普通
     */
    private LogoStyle logoStyle;


    /**
     * 生成二維碼的寬
     */
    private Integer w;


    /**
     * 生成二維碼的高
     */
    private Integer h;


    /**
     * 生成二維碼的顏色
     */
    private MatrixToImageConfig matrixToImageConfig;


    private Map<EncodeHintType, Object> hints;


    /**
     * 生成二維碼圖片的格式 png, jpg
     */
    private String picType;


    public enum LogoStyle {
        ROUND,
        NORMAL;
    }
}

從上面的配置來看,有較多實際上是與zxing進行打交道的,直接對使用者而言,有點不太友好,下面能夠看下咱們的包裝類web

2. 包裝類: QrCodeGenWrapper

對外提供二維碼生成的主要入口,從咱們的設計來看,經過of(content) 來建立一個builder對象,並設置二維碼的內容,而後能夠設置builder中的參數,來選擇最終的二維碼配置規則spring

提供三中輸出方式:設計模式

  • BufferImage 對象 : 適用於對二維碼進行再次處理的場景
  • 二維碼圖片文件 : 適用於本地生成
  • base64編碼的二維碼字符串 : 適用於網絡接口調用

下面的實現比較簡單,惟一須要注意的就是組裝 QrCodeOptions 參數的默認值問題網絡

public class QrCodeGenWrapper {
    public static Builder of(String content) {
        return new Builder().setMsg(content);
    }


    private static BufferedImage asBufferedImage(QrCodeOptions qrCodeConfig) throws WriterException, IOException {
        BitMatrix bitMatrix = QrCodeUtil.encode(qrCodeConfig);
        return QrCodeUtil.toBufferedImage(qrCodeConfig, bitMatrix);
    }

    private static String asString(QrCodeOptions qrCodeOptions) throws WriterException, IOException {
        BufferedImage bufferedImage = asBufferedImage(qrCodeOptions);
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        ImageIO.write(bufferedImage, qrCodeOptions.getPicType(), outputStream);
        return Base64Util.encode(outputStream);
    }

    private static boolean asFile(QrCodeOptions qrCodeConfig, String absFileName) throws WriterException, IOException {
        File file = new File(absFileName);
        FileUtil.mkDir(file);

        BufferedImage bufferedImage = asBufferedImage(qrCodeConfig);
        if (!ImageIO.write(bufferedImage, qrCodeConfig.getPicType(), file)) {
            throw new IOException("save qrcode image error!");
        }

        return true;
    }


    @ToString
    public static class Builder {
        private static final MatrixToImageConfig DEFAULT_CONFIG = new MatrixToImageConfig();

        /**
         * The message to put into QrCode
         */
        private String msg;


        /**
         * qrcode center logo
         */
        private String logo;


        /**
         * logo的樣式
         */
        private QrCodeOptions.LogoStyle logoStyle = QrCodeOptions.LogoStyle.NORMAL;


        /**
         * qrcode image width
         */
        private Integer w;


        /**
         * qrcode image height
         */
        private Integer h;


        /**
         * qrcode bgcolor, default white
         */
        private Integer bgColor;


        /**
         * qrcode msg color, default black
         */
        private Integer preColor;


        /**
         * qrcode message's code, default UTF-8
         */
        private String code = "utf-8";


        /**
         * 0 - 4
         */
        private Integer padding;


        /**
         * error level, default H
         */
        private ErrorCorrectionLevel errorCorrection = ErrorCorrectionLevel.H;


        /**
         * output qrcode image type, default png
         */
        private String picType = "png";


        public String getMsg() {
            return msg;
        }

        public Builder setMsg(String msg) {
            this.msg = msg;
            return this;
        }

        public Builder setLogo(String logo) {
            this.logo = logo;
            return this;
        }


        public Builder setLogoStyle(QrCodeOptions.LogoStyle logoStyle) {
            this.logoStyle = logoStyle;
            return this;
        }


        public Integer getW() {
            return w == null ? (h == null ? 200 : h) : w;
        }

        public Builder setW(Integer w) {
            if (w != null && w <= 0) {
                throw new IllegalArgumentException("生成二維碼的寬必須大於0");
            }
            this.w = w;
            return this;
        }

        public Integer getH() {
            return h == null ? (w == null ? 200 : w) : h;
        }

        public Builder setH(Integer h) {
            if (h != null && h <= 0) {
                throw new IllegalArgumentException("生成功能二維碼的搞必須大於0");
            }
            this.h = h;
            return this;
        }

        public Integer getBgColor() {
            return bgColor == null ? MatrixToImageConfig.WHITE : bgColor;
        }

        public Builder setBgColor(Integer bgColor) {
            this.bgColor = bgColor;
            return this;
        }

        public Integer getPreColor() {
            return preColor == null ? MatrixToImageConfig.BLACK : preColor;
        }

        public Builder setPreColor(Integer preColor) {
            this.preColor = preColor;
            return this;
        }

        public Builder setCode(String code) {
            this.code = code;
            return this;
        }

        public Integer getPadding() {
            if (padding == null) {
                return 1;
            }

            if (padding < 0) {
                return 0;
            }

            if (padding > 4) {
                return 4;
            }

            return padding;
        }

        public Builder setPadding(Integer padding) {
            this.padding = padding;
            return this;
        }

        public Builder setPicType(String picType) {
            this.picType = picType;
            return this;
        }

        public void setErrorCorrection(ErrorCorrectionLevel errorCorrection) {
            this.errorCorrection = errorCorrection;
        }

        private void validate() {
            if (msg == null || msg.length() == 0) {
                throw new IllegalArgumentException("生成二維碼的內容不能爲空!");
            }
        }


        private QrCodeOptions build() {
            this.validate();

            QrCodeOptions qrCodeConfig = new QrCodeOptions();
            qrCodeConfig.setMsg(getMsg());
            qrCodeConfig.setH(getH());
            qrCodeConfig.setW(getW());
            qrCodeConfig.setLogo(logo);
            qrCodeConfig.setLogoStyle(logoStyle);
            qrCodeConfig.setPicType(picType);

            Map<EncodeHintType, Object> hints = new HashMap<>(3);
            hints.put(EncodeHintType.ERROR_CORRECTION, errorCorrection);
            hints.put(EncodeHintType.CHARACTER_SET, code);
            hints.put(EncodeHintType.MARGIN, this.getPadding());
            qrCodeConfig.setHints(hints);


            MatrixToImageConfig config;
            if (getPreColor() == MatrixToImageConfig.BLACK
                    && getBgColor() == MatrixToImageConfig.WHITE) {
                config = DEFAULT_CONFIG;
            } else {
                config = new MatrixToImageConfig(getPreColor(), getBgColor());
            }
            qrCodeConfig.setMatrixToImageConfig(config);


            return qrCodeConfig;
        }


        public String asString() throws IOException, WriterException {
            return QrCodeGenWrapper.asString(build());
        }


        public BufferedImage asBufferedImage() throws IOException, WriterException {
            return QrCodeGenWrapper.asBufferedImage(build());
        }


        public boolean asFile(String absFileName) throws IOException, WriterException {
            return QrCodeGenWrapper.asFile(build(), absFileName);
        }
    }
}

二維碼生成工具類 : QrCodeUtil

下面這個工具類看着比較複雜,其實大部分代碼是從 com.google.zxing.qrcode.QRCodeWriter#encode(String, BarcodeFormat, int, int, Map) 摳出來的app

主要是爲了解決二維碼的白邊問題,關於這個大白邊問題,能夠參看我以前的一篇博文 《zxing 二維碼大白邊一步一步修復指南》spring-boot

@Slf4j
public class QrCodeUtil {

    private static final int QUIET_ZONE_SIZE = 4;


    /**
     * 對 zxing 的 QRCodeWriter 進行擴展, 解決白邊過多的問題
     * <p/>
     * 源碼參考 {@link com.google.zxing.qrcode.QRCodeWriter#encode(String, BarcodeFormat, int, int, Map)}
     */
    public static BitMatrix encode(QrCodeOptions qrCodeConfig) throws WriterException {
        ErrorCorrectionLevel errorCorrectionLevel = ErrorCorrectionLevel.L;
        int quietZone = 1;
        if (qrCodeConfig.getHints() != null) {
            if (qrCodeConfig.getHints().containsKey(EncodeHintType.ERROR_CORRECTION)) {
                errorCorrectionLevel = ErrorCorrectionLevel.valueOf(qrCodeConfig.getHints().get(EncodeHintType.ERROR_CORRECTION).toString());
            }
            if (qrCodeConfig.getHints().containsKey(EncodeHintType.MARGIN)) {
                quietZone = Integer.parseInt(qrCodeConfig.getHints().get(EncodeHintType.MARGIN).toString());
            }

            if (quietZone > QUIET_ZONE_SIZE) {
                quietZone = QUIET_ZONE_SIZE;
            } else if (quietZone < 0) {
                quietZone = 0;
            }
        }

        QRCode code = Encoder.encode(qrCodeConfig.getMsg(), errorCorrectionLevel, qrCodeConfig.getHints());
        return renderResult(code, qrCodeConfig.getW(), qrCodeConfig.getH(), quietZone);
    }


    /**
     * 對 zxing 的 QRCodeWriter 進行擴展, 解決白邊過多的問題
     * <p/>
     * 源碼參考 {@link com.google.zxing.qrcode.QRCodeWriter#renderResult(QRCode, int, int, int)}
     *
     * @param code
     * @param width
     * @param height
     * @param quietZone 取值 [0, 4]
     * @return
     */
    private static BitMatrix renderResult(QRCode code, int width, int height, int quietZone) {
        ByteMatrix input = code.getMatrix();
        if (input == null) {
            throw new IllegalStateException();
        }

        // xxx 二維碼寬高相等, 即 qrWidth == qrHeight
        int inputWidth = input.getWidth();
        int inputHeight = input.getHeight();
        int qrWidth = inputWidth + (quietZone * 2);
        int qrHeight = inputHeight + (quietZone * 2);


        // 白邊過多時, 縮放
        int minSize = Math.min(width, height);
        int scale = calculateScale(qrWidth, minSize);
        if (scale > 0) {
            if (log.isDebugEnabled()) {
                log.debug("qrCode scale enable! scale: {}, qrSize:{}, expectSize:{}x{}", scale, qrWidth, width, height);
            }

            int padding, tmpValue;
            // 計算邊框留白
            padding = (minSize - qrWidth * scale) / QUIET_ZONE_SIZE * quietZone;
            tmpValue = qrWidth * scale + padding;
            if (width == height) {
                width = tmpValue;
                height = tmpValue;
            } else if (width > height) {
                width = width * tmpValue / height;
                height = tmpValue;
            } else {
                height = height * tmpValue / width;
                width = tmpValue;
            }
        }

        int outputWidth = Math.max(width, qrWidth);
        int outputHeight = Math.max(height, qrHeight);

        int multiple = Math.min(outputWidth / qrWidth, outputHeight / qrHeight);
        int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
        int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

        BitMatrix output = new BitMatrix(outputWidth, outputHeight);

        for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
            // Write the contents of this row of the barcode
            for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
                if (input.get(inputX, inputY) == 1) {
                    output.setRegion(outputX, outputY, multiple, multiple);
                }
            }
        }

        return output;
    }


    /**
     * 若是留白超過15% , 則須要縮放
     * (15% 能夠根據實際須要進行修改)
     *
     * @param qrCodeSize 二維碼大小
     * @param expectSize 指望輸出大小
     * @return 返回縮放比例, <= 0 則表示不縮放, 不然指定縮放參數
     */
    private static int calculateScale(int qrCodeSize, int expectSize) {
        if (qrCodeSize >= expectSize) {
            return 0;
        }

        int scale = expectSize / qrCodeSize;
        int abs = expectSize - scale * qrCodeSize;
        if (abs < expectSize * 0.15) {
            return 0;
        }

        return scale;
    }



    /**
     * 根據二維碼配置 & 二維碼矩陣生成二維碼圖片
     *
     * @param qrCodeConfig
     * @param bitMatrix
     * @return
     * @throws IOException
     */
    public static BufferedImage toBufferedImage(QrCodeOptions qrCodeConfig, BitMatrix bitMatrix) throws IOException {
        int qrCodeWidth = bitMatrix.getWidth();
        int qrCodeHeight = bitMatrix.getHeight();
        BufferedImage qrCode = new BufferedImage(qrCodeWidth, qrCodeHeight, BufferedImage.TYPE_INT_RGB);

        for (int x = 0; x < qrCodeWidth; x++) {
            for (int y = 0; y < qrCodeHeight; y++) {
                qrCode.setRGB(x, y,
                        bitMatrix.get(x, y) ?
                                qrCodeConfig.getMatrixToImageConfig().getPixelOnColor() :
                                qrCodeConfig.getMatrixToImageConfig().getPixelOffColor());
            }
        }

        // 插入logo
        if (!(qrCodeConfig.getLogo() == null || "".equals(qrCodeConfig.getLogo()))) {
            ImageUtil.insertLogo(qrCode, qrCodeConfig.getLogo(), qrCodeConfig.getLogoStyle());
        }

        // 若二維碼的實際寬高和預期的寬高不一致, 則縮放
        int realQrCodeWidth = qrCodeConfig.getW();
        int realQrCodeHeight = qrCodeConfig.getH();
        if (qrCodeWidth != realQrCodeWidth || qrCodeHeight != realQrCodeHeight) {
            BufferedImage tmp = new BufferedImage(realQrCodeWidth, realQrCodeHeight, BufferedImage.TYPE_INT_RGB);
            tmp.getGraphics().drawImage(
                    qrCode.getScaledInstance(realQrCodeWidth, realQrCodeHeight,
                            Image.SCALE_SMOOTH), 0, 0, null);
            qrCode = tmp;
        }

        return qrCode;
    }

}

4. logo的插入輔助類: ImageUtil

zxing自己是不支持生成待logo的二維碼的,這裏咱們借用awt對將logo繪製在生成的二維碼圖片上

這裏提供了圓角圖片生成,邊框生成,插入logo三個功能

涉及到繪圖的邏輯,也沒啥可說的,基本上的套路都同樣

public class ImageUtil {

    /**
     * 在圖片中間,插入圓角的logo
     *
     * @param qrCode 原圖
     * @param logo   logo地址
     * @throws IOException
     */
    public static void insertLogo(BufferedImage qrCode, String logo, QrCodeOptions.LogoStyle logoStyle) throws IOException {
        int QRCODE_WIDTH = qrCode.getWidth();
        int QRCODE_HEIGHT = qrCode.getHeight();

        // 獲取logo圖片
        BufferedImage bf = getImageByPath(logo);
        int size = bf.getWidth() > QRCODE_WIDTH * 2 / 10 ? QRCODE_WIDTH * 2 / 50 : bf.getWidth() / 5;
        bf = ImageUtil.makeRoundBorder(bf, logoStyle, size, Color.BLUE); // 邊距爲二維碼圖片的1/10

        // logo的寬高
        int w = bf.getWidth() > QRCODE_WIDTH * 2 / 10 ? QRCODE_WIDTH * 2 / 10 : bf.getWidth();
        int h = bf.getHeight() > QRCODE_HEIGHT * 2 / 10 ? QRCODE_HEIGHT * 2 / 10 : bf.getHeight();

        // 插入LOGO
        Graphics2D graph = qrCode.createGraphics();

        int x = (QRCODE_WIDTH - w) / 2;
        int y = (QRCODE_HEIGHT - h) / 2;

        graph.drawImage(bf, x, y, w, h, null);
        graph.dispose();
        bf.flush();
    }


    /**
     * 根據路徑獲取圖片
     *
     * @param path 本地路徑 or 網絡地址
     * @return 圖片
     * @throws IOException
     */
    public static BufferedImage getImageByPath(String path) throws IOException {
        if (path.startsWith("http")) { // 從網絡獲取logo
//            return ImageIO.read(new URL(path));
            return ImageIO.read(HttpUtil.downFile(path));
        } else if (path.startsWith("/")) { // 絕對地址獲取logo
            return ImageIO.read(new File(path));
        } else { // 從資源目錄下獲取logo
            return ImageIO.read(ImageUtil.class.getClassLoader().getResourceAsStream(path));
        }
    }


    /**
     * fixme 邊框的計算須要根據最終生成logo圖片的大小來定義,這樣纔不會出現不一樣的logo原圖,致使邊框不一致的問題
     *
     * 生成圓角圖片 & 圓角邊框
     *
     * @param image        原圖
     * @param logoStyle 圓角的角度
     * @param size         邊框的邊距
     * @param color        邊框的顏色
     * @return 返回帶邊框的圓角圖
     */
    public static BufferedImage makeRoundBorder(BufferedImage image, QrCodeOptions.LogoStyle logoStyle, int size, Color color) {
        // 將圖片變成圓角
        int cornerRadius = 0;
        if (logoStyle == QrCodeOptions.LogoStyle.ROUND) {
            cornerRadius = 30;
            image = makeRoundedCorner(image, cornerRadius);
        }

        int borderSize = size;
        int w = image.getWidth() + borderSize;
        int h = image.getHeight() + borderSize;
        BufferedImage output = new BufferedImage(w, h,
                BufferedImage.TYPE_INT_ARGB);

        Graphics2D g2 = output.createGraphics();
        g2.setComposite(AlphaComposite.Src);
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
        g2.setColor(color == null ? Color.WHITE : color);
        g2.fill(new RoundRectangle2D.Float(0, 0, w, h, cornerRadius,
                cornerRadius));

        // ... then compositing the image on top,
        // using the white shape from above as alpha source
        g2.setComposite(AlphaComposite.SrcAtop);
        g2.drawImage(image, size, size, null);
        g2.dispose();

        return output;
    }


    /**
     * 生成圓角圖片
     *
     * @param image        原始圖片
     * @param cornerRadius 圓角的弧度
     * @return 返回圓角圖
     */
    public static BufferedImage makeRoundedCorner(BufferedImage image,
                                                  int cornerRadius) {
        int w = image.getWidth();
        int h = image.getHeight();
        BufferedImage output = new BufferedImage(w, h,
                BufferedImage.TYPE_INT_ARGB);

        Graphics2D g2 = output.createGraphics();

        // This is what we want, but it only does hard-clipping, i.e. aliasing
        // g2.setClip(new RoundRectangle2D ...)

        // so instead fake soft-clipping by first drawing the desired clip shape
        // in fully opaque white with antialiasing enabled...
        g2.setComposite(AlphaComposite.Src);
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
        g2.setColor(Color.WHITE);
        g2.fill(new RoundRectangle2D.Float(0, 0, w, h, cornerRadius,
                cornerRadius));

        // ... then compositing the image on top,
        // using the white shape from above as alpha source
        g2.setComposite(AlphaComposite.SrcAtop);
        g2.drawImage(image, 0, 0, null);

        g2.dispose();

        return output;
    }
}

5. base64編碼工具: Base64Util

public class Base64Util {
    public static String encode(ByteArrayOutputStream outputStream) {
        return Base64.getEncoder().encodeToString(outputStream.toByteArray());
    }
}

6. 二維碼解析工具: QrCodeDeWrapper

public class QrCodeDeWrapper {


    /**
     * 讀取二維碼中的內容, 並返回
     *
     * @param qrcodeImg 二維碼圖片的地址
     * @return 返回二維碼的內容
     * @throws IOException       讀取二維碼失敗
     * @throws FormatException   二維碼解析失敗
     * @throws ChecksumException
     * @throws NotFoundException
     */
    public static String decode(String qrcodeImg) throws IOException, FormatException, ChecksumException, NotFoundException {
        BufferedImage image = ImageUtil.getImageByPath(qrcodeImg);
        return decode(image);
    }


    public static String decode(BufferedImage image) throws FormatException, ChecksumException, NotFoundException {
        if (image == null) {
            throw new IllegalStateException("can not load qrCode!");
        }


        LuminanceSource source = new BufferedImageLuminanceSource(image);
        BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
        QRCodeReader qrCodeReader = new QRCodeReader();
        Result result = qrCodeReader.decode(bitmap);
        return result.getText();
    }

}

3. 填坑

1. 生成二維碼邊框過大的問題

即使指定了生成二維碼圖片的邊距爲0,可是最終生成的二維碼圖片邊框依然可能很大

以下圖

http://git.oschina.net/uploads/images/2017/0403/120101_e6d40bcb_2334.jpeg

這個問題上面已經修復,產生的緣由和修復過程能夠查看 zxing 二維碼大白邊一步一步修復指南

修復以後以下圖

http://git.oschina.net/uploads/images/2017/0403/120811_9014928b_2334.jpeg

2. 插入logo

上面雖然實現了插入logo的邏輯,可是生成的邊框處有點問題,坑還沒填

但願是指定邊框大小時,無論logo圖片有多大,最終的邊框同樣大小,而上面卻有點問題...

此外就是生成的logo樣式不美觀,不能忍啊

演示說明

暴露對應的http接口比較簡單,能夠直接查看工程源碼,下面啓動spring-boot,而後開始愉快的進行http測試;

http://s2.mogucdn.com/mlcdn/c45406/170718_0k9k6l56d5h47f095abk58l42hc54_1226x610.gif

4. 其餘

項目源碼: https://github.com/liuyueyi/quick-media

我的博客:一灰的我的博客

公衆號獲取更多:

https://static.oschina.net/uploads/img/201707/09205944_0PzS.jpg

相關文章
相關標籤/搜索