fix bug:JSON Parse Error in authSlice.js: Parsing 'undefined' Value C… (#4612)

fix bug:JSON Parse Error in authSlice.js: Parsing 'undefined' Value Causes Blank Page#4611
This commit is contained in:
zuyuanceo
2025-06-09 07:40:30 +08:00
committed by GitHub
parent 12b4259a01
commit 8272283618
+4 -1
View File
@@ -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({