From 0271aa5414843f662c74a683cfc36f5f799d2a3c Mon Sep 17 00:00:00 2001 From: guxin0123 Date: Wed, 16 Mar 2022 04:52:33 +0000 Subject: [PATCH] =?UTF-8?q?update=20ruoyi-ui/src/store/modules/user.js.=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E5=BA=93=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=A1=A8=20=E5=A4=B4=E5=83=8F=E5=88=97=E4=B8=BA=20null=20?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=BB=98=E8=AE=A4=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/store/modules/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/src/store/modules/user.js b/ruoyi-ui/src/store/modules/user.js index fce1a86b8..23953195c 100644 --- a/ruoyi-ui/src/store/modules/user.js +++ b/ruoyi-ui/src/store/modules/user.js @@ -51,7 +51,7 @@ const user = { return new Promise((resolve, reject) => { getInfo().then(res => { const user = res.user - const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; + const avatar = ( user.avatar == "" || user.avatar == null ) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 commit('SET_ROLES', res.roles) commit('SET_PERMISSIONS', res.permissions)