From fdab3659ccadc8276f3e423973d18d4fbca092a8 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期六, 05 八月 2023 17:15:09 +0800 Subject: [PATCH] Fixed: [弱掃] p11.2 Bad use of null-like value --- PAMapp/pages/notification/index.vue | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/PAMapp/pages/notification/index.vue b/PAMapp/pages/notification/index.vue index c6c9ac9..f3de575 100644 --- a/PAMapp/pages/notification/index.vue +++ b/PAMapp/pages/notification/index.vue @@ -57,10 +57,21 @@ //////////////////////////////////////////////////////////// - mounted() { - this.isUserLogin = authService.isUserLogin(); - reviewsService.readAllMyNotification().then(res => res); + async mounted() { + this.isUserLogin = authService.isUserLogin(); + + try { + const response = await reviewsService.readAllMyNotification(); + if (response !== null) { + } else { + throw new Error('reviewsService.readAllMyNotification returned null-like value.'); + } + } catch (error) { + console.error('An error occurred while reading all notifications:', error); + throw error; } + } + } </script> -- Gitblit v1.8.0