File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { permissionListToPermissions } from '@/utils/permissions'
5
5
import defaultAvatar from '@/assets/logo.png'
6
6
import { logout as ssoLogout } from '@/utils/sso'
7
7
import { baseURL } from '@/utils/request'
8
+ import avatar from 'element-ui/packages/avatar'
8
9
9
10
const state = {
10
11
token : getToken ( ) ,
@@ -86,8 +87,9 @@ const actions = {
86
87
87
88
commit ( 'SET_NAME' , name )
88
89
commit ( 'SET_INFO' , info )
89
- const isExternal = / ^ ( h t t p s ? : | m a i l t o : | t e l : | \/ \/ ) / . test ( info . avatarUrl )
90
- commit ( 'SET_AVATAR' , isExternal ? info . avatarUrl : info . avatarUrl ? baseURL + info . avatarUrl : null )
90
+ const avatarUrl = info && info . avatarUrl ? info . avatarUrl : null
91
+ const isExternal = / ^ ( h t t p s ? : | m a i l t o : | t e l : | \/ \/ ) / . test ( avatarUrl )
92
+ commit ( 'SET_AVATAR' , isExternal ? avatarUrl : avatarUrl ? baseURL + avatarUrl : null )
91
93
resolve ( data )
92
94
} ) . catch ( error => {
93
95
reject ( error )
You can’t perform that action at this time.
0 commit comments