fix: registration code (broke in merge)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
51f8d0fb42
commit
123509d0a6
@ -13,5 +13,4 @@ const config = {
|
|||||||
url_imprint: '',
|
url_imprint: '',
|
||||||
// optional, will fallback to baseurl_selfservice/privacy
|
// optional, will fallback to baseurl_selfservice/privacy
|
||||||
url_privacy: '',
|
url_privacy: '',
|
||||||
codeformat: 'code39'
|
|
||||||
};
|
};
|
||||||
|
@ -638,17 +638,19 @@ import axios from "redaxios";
|
|||||||
import bwipjs from "bwip-js";
|
import bwipjs from "bwip-js";
|
||||||
|
|
||||||
function textToBase64Barcode(text) {
|
function textToBase64Barcode(text) {
|
||||||
var canvas = document.createElement("canvas");
|
const canvas = document.createElement("canvas");
|
||||||
bwipjs.toCanvas(canvas, {
|
let codeconfig = {
|
||||||
bcid: config.codeformat || "code39",
|
bcid: config.code_format || "code39",
|
||||||
text: `${text}`,
|
text: `${text}`,
|
||||||
scale: 3,
|
scale: 3,
|
||||||
height: 10,
|
|
||||||
// width: 10,
|
|
||||||
includetext: false,
|
includetext: false,
|
||||||
textxalign: "center",
|
textxalign: "center",
|
||||||
backgroundcolor: "ffffff",
|
backgroundcolor: "ffffff",
|
||||||
});
|
};
|
||||||
|
if (codeconfig.bcid === "code39" || codeconfig.bcid === "code128"|| codeconfig.bcid === "ean13") {
|
||||||
|
codeconfig.height = 10;
|
||||||
|
}
|
||||||
|
bwipjs.toCanvas(canvas, codeconfig);
|
||||||
return canvas.toDataURL("image/png");
|
return canvas.toDataURL("image/png");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -749,13 +751,13 @@ function get_certificate() {
|
|||||||
} else {
|
} else {
|
||||||
var fileURL = window.URL.createObjectURL(
|
var fileURL = window.URL.createObjectURL(
|
||||||
new Blob([response.data], { type: "application/pdf" })
|
new Blob([response.data], { type: "application/pdf" })
|
||||||
);
|
);
|
||||||
var fileLink = document.createElement("a");
|
var fileLink = document.createElement("a");
|
||||||
|
|
||||||
fileLink.href = fileURL;
|
fileLink.href = fileURL;
|
||||||
fileLink.setAttribute("download", "Certificate.pdf");
|
fileLink.setAttribute("download", "Certificate.pdf");
|
||||||
document.body.appendChild(fileLink);
|
document.body.appendChild(fileLink);
|
||||||
|
|
||||||
fileLink.click();
|
fileLink.click();
|
||||||
fileLink.remove();
|
fileLink.remove();
|
||||||
toast.clear();
|
toast.clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user