From f95e5b17c5c68bd950614dd9b007468e2b4c4c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Fri, 3 Nov 2023 09:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9base64=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/LawyerArchivesUnAuthorizeController.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/24Hour/Controllers/Common/LawyerArchivesUnAuthorizeController.cs b/24Hour/Controllers/Common/LawyerArchivesUnAuthorizeController.cs index 5508f6d..1ea2125 100644 --- a/24Hour/Controllers/Common/LawyerArchivesUnAuthorizeController.cs +++ b/24Hour/Controllers/Common/LawyerArchivesUnAuthorizeController.cs @@ -131,7 +131,18 @@ namespace _24Hour.Controllers.Common Result result = new(); try { - result.result = Encoding.UTF8.GetString(Convert.FromBase64String(data.QRData)); + var qrdata = data.QRData; + var count = data.QRData.Length; + var a = count % 4; + if (a != 0) + { + + for (int i = 0; i < a; i++) + { + qrdata += "="; + } + } + result.result = Encoding.UTF8.GetString(Convert.FromBase64String(qrdata)); result.IsSucceed = true; return Task.FromResult(result); } @@ -143,4 +154,4 @@ namespace _24Hour.Controllers.Common } } } -} +} \ No newline at end of file