From 16f3e526ba239f105abc33d2a3e20d2f207c19c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E6=A5=BD=E5=9D=82=20=E7=99=BD?= Date: Sat, 11 Nov 2023 05:50:41 +0000 Subject: [PATCH 1/4] fixbug --- app/Http/Controllers/MailController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/MailController.php b/app/Http/Controllers/MailController.php index 8e5964c..ea648c2 100644 --- a/app/Http/Controllers/MailController.php +++ b/app/Http/Controllers/MailController.php @@ -71,10 +71,12 @@ function ($attribute, $value, $fail) { try { $key = Crypt::decryptString($key); $key = json_decode($key, true); - if (time() - $key['time'] < 300 && !empty($key['id'])) { + if (!empty($key['id'])) { $where[] = ['id', '>', $key['id']]; + } elseif (time() - $key['time'] < 300) { + $where[] = ['received_at', '>', Carbon::parse($key['time'])]; } else { - $where[] = ['received_at', '>', Carbon::now()]; + $where[] = ['received_at', '>', Carbon::now() - 60]; } } catch (\Throwable $th) { return abort(400); @@ -125,11 +127,14 @@ public function put(Request $request) return abort(401); } + $to = strtolower($to); + $from = strtolower($from); + $mail = new Mail; $mail->from = $from; $mail->from_hash = hash('sha256', $from); - $mail->to = strtolower($to); + $mail->to = $to; $mail->to_hash = hash('sha256', $to); $mail->title = $title; From 1956a7627851e911601921a82e2e1e62fee5bcc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E6=A5=BD=E5=9D=82=20=E7=99=BD?= Date: Tue, 14 Nov 2023 01:23:57 +0000 Subject: [PATCH 2/4] mail view height --- resources/views/welcome.blade.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index e317b48..7707e99 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -395,6 +395,15 @@ function fetchMail() { $('#exampleModalLabel').text(text); // 显示模态框 $('#myModal').modal('show'); + var iframeHeight = $('#modalIframe').contents().find("html").height(); + console.log("Iframe的实际高度是: " + iframeHeight + "px"); + if (iframeHeight >= 600){ + $('#modalIframe').css('height',600); + } else { + $('#modalIframe').css('height',iframeHeight); + } + + } catch (e) { console.error('Error parsing API response or decoding base64:', e); } From a802fa14e3afb9ff6e508280948de7bbd3051ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E6=A5=BD=E5=9D=82=20=E7=99=BD?= Date: Tue, 14 Nov 2023 01:49:12 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/welcome.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 7707e99..7530054 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -395,7 +395,7 @@ function fetchMail() { $('#exampleModalLabel').text(text); // 显示模态框 $('#myModal').modal('show'); - var iframeHeight = $('#modalIframe').contents().find("html").height(); + let iframeHeight = $('#modalIframe').contents().find("html").height(); console.log("Iframe的实际高度是: " + iframeHeight + "px"); if (iframeHeight >= 600){ $('#modalIframe').css('height',600); From 3c051cab173d7e535248a8e3f7a9300e68cd6e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E6=A5=BD=E5=9D=82=20=E7=99=BD?= Date: Wed, 15 Nov 2023 01:22:15 +0000 Subject: [PATCH 4/4] fixbug --- resources/views/welcome.blade.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 7530054..e313d0d 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -372,6 +372,18 @@ function fetchMail() { }); }, 1000 * 60); + $('#myModal').on('shown.bs.modal', function () { + let iframeHeight = $('#modalIframe').contents().find("html").height(); + console.log("Iframe的实际高度是: " + iframeHeight + "px"); + if (iframeHeight <= 600){ + $('#modalIframe').css('height',600); + } else if (iframeHeight >= 800){ + $('#modalIframe').css('height',800); + } else { + $('#modalIframe').css('height',iframeHeight); + } + }); + $(document).on('click', '.info-btn', function () { let key = $(this).data('key'); let apiUrl = '/mail/' + key; @@ -395,13 +407,7 @@ function fetchMail() { $('#exampleModalLabel').text(text); // 显示模态框 $('#myModal').modal('show'); - let iframeHeight = $('#modalIframe').contents().find("html").height(); - console.log("Iframe的实际高度是: " + iframeHeight + "px"); - if (iframeHeight >= 600){ - $('#modalIframe').css('height',600); - } else { - $('#modalIframe').css('height',iframeHeight); - } + } catch (e) {