From 827228361875a1b48379f18f8f855684ebb1b000 Mon Sep 17 00:00:00 2001 From: zuyuanceo <70935645+caizhiqiangzeyuan@users.noreply.github.com> Date: Mon, 9 Jun 2025 07:40:30 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug:JSON=20Parse=20Error=20in=20authSlice?= =?UTF-8?q?.js:=20Parsing=20'undefined'=20Value=20C=E2=80=A6=20(#4612)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix bug:JSON Parse Error in authSlice.js: Parsing 'undefined' Value Causes Blank Page#4611 --- packages/ui/src/store/reducers/authSlice.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/store/reducers/authSlice.js b/packages/ui/src/store/reducers/authSlice.js index 21363468..6397949c 100644 --- a/packages/ui/src/store/reducers/authSlice.js +++ b/packages/ui/src/store/reducers/authSlice.js @@ -11,7 +11,10 @@ const initialState = { localStorage.getItem('permissions') && localStorage.getItem('permissions') !== 'undefined' ? JSON.parse(localStorage.getItem('permissions')) : null, - features: localStorage.getItem('features') ? JSON.parse(localStorage.getItem('features')) : null + features: + localStorage.getItem('features') && localStorage.getItem('features') !== 'undefined' + ? JSON.parse(localStorage.getItem('features')) + : null } const authSlice = createSlice({