mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
优化QrCodeUtil生成base64方法,支持svg、txt
This commit is contained in:
@@ -41,7 +41,7 @@ public class QrCodeUtilTest {
|
||||
// 背景色透明
|
||||
config.setBackColor(null);
|
||||
config.setErrorCorrection(ErrorCorrectionLevel.H);
|
||||
String path = FileUtil.isWindows() ? "d:/test/qrcodeCustom.txt" : "~/Desktop/hutool/qrcodeCustom.svg";
|
||||
String path = FileUtil.isWindows() ? "d:/test/qrcodeCustom.png" : "~/Desktop/hutool/qrcodeCustom.png";
|
||||
QrCodeUtil.generate("https://hutool.cn/", config, FileUtil.touch(path));
|
||||
}
|
||||
|
||||
@@ -87,6 +87,13 @@ public class QrCodeUtilTest {
|
||||
Assert.assertNotNull(base641);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void generateAsBase64Test3() {
|
||||
String base64 = QrCodeUtil.generateAsBase64("https://hutool.cn/", new QrConfig(400, 400), "svg");
|
||||
Assert.assertNotNull(base64);
|
||||
System.out.println(base64);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void decodeTest3() {
|
||||
|
Reference in New Issue
Block a user