Commit 33ddb6f7feeb0586a3d339b6cc9de796dbb2e035

Authored by ww
1 parent 741429eb

fix: 修复获取用户信息会存在报错情况

@@ -59,8 +59,8 @@ const USER_PERMISSION = { @@ -59,8 +59,8 @@ const USER_PERMISSION = {
59 const IS_CUSTOMER_USER = (() => { 59 const IS_CUSTOMER_USER = (() => {
60 const ls = createStorage({ storage: localStorage }) 60 const ls = createStorage({ storage: localStorage })
61 const common = ls.get(GLOBAL_STORAGE_KEY) || { USER__INFO__: {} } 61 const common = ls.get(GLOBAL_STORAGE_KEY) || { USER__INFO__: {} }
62 - const userInfo = common.USER__INFO__.value || {}  
63 - return (userInfo.roles || [])[0] === 'CUSTOMER_USER' 62 + const userInfo = ((common || {}).USER__INFO__ || {}).value || {}
  63 + return (((userInfo || {})).roles || [])[0] === 'CUSTOMER_USER'
64 })() 64 })()
65 65
66 const hasSavePermission = () => { 66 const hasSavePermission = () => {