From 5830681e23526725206afffb0b086bcdb517863e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=97=8F=E6=9F=8F?= Date: Fri, 19 Apr 2024 13:58:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(js):=20=E8=A7=A3=E5=86=B3=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E6=88=96=E7=B3=BB=E7=BB=9F=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=A8=8B=E5=BA=8F=E5=A4=8D=E5=88=B6=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #3 --- src/main/resources/static/js/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/resources/static/js/index.js b/src/main/resources/static/js/index.js index 6875a7b..2c4a7a9 100644 --- a/src/main/resources/static/js/index.js +++ b/src/main/resources/static/js/index.js @@ -55,8 +55,8 @@ $(document).ready(function() { $.post('/generateLicense', JSON.stringify(data)) .then(response => { copyText(response) - .then(() => { - alert("The activation code has been copied"); + .then((result) => { + alert(result); }); }); }; @@ -65,6 +65,10 @@ $(document).ready(function() { const copyText = async (val) => { if (navigator.clipboard && navigator.permissions) { await navigator.clipboard.writeText(val); + return "The activation code has been copied"; + } else { + console.log(val); + return "The system does not support it, please go to the console to copy it manually"; } };