在Windows系统上构建

This commit is contained in:
cheney
2026-07-09 20:03:35 +08:00
parent 22ae3ac755
commit 0652323b85
11 changed files with 642 additions and 19 deletions
+16
View File
@@ -0,0 +1,16 @@
// 生成测试用二维码图片(PNG),便于用「从图片扫描」功能验证。
// 用法:node tests/fixtures/generate-qr.mjs [网址] [输出路径]
import QRCode from "qrcode";
import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path";
const __dirname = dirname(fileURLToPath(import.meta.url));
const url = process.argv[2] || "https://fapiao.example.com/open?id=20240701";
const out = resolve(__dirname, process.argv[3] || "sample-qr.png");
await QRCode.toFile(out, url, {
errorCorrectionLevel: "M",
margin: 4,
scale: 8,
});
console.log(`已生成二维码图片: ${out}\n内容: ${url}`);