From 8b6fb450a69a1e3d267f3b15df4aaaf2828de94c Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Thu, 16 Mar 2023 09:44:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=B7=B3=E8=BD=AC=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nladmin-system/src/main/java/org/nl/utils/FileUtil.java | 2 +- .../src/main/java/org/nl/utils/StringUtils.java | 3 ++- mes/qd/src/store/modules/user.js | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/utils/FileUtil.java b/mes/hd/nladmin-system/src/main/java/org/nl/utils/FileUtil.java index f2cc72f8..fb6f32b2 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/utils/FileUtil.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/utils/FileUtil.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.nl.modules.common.utils; +package org.nl.utils; import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.IdUtil; diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/utils/StringUtils.java b/mes/hd/nladmin-system/src/main/java/org/nl/utils/StringUtils.java index 269c7f5d..5b3a8283 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/utils/StringUtils.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/utils/StringUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.nl.modules.common.utils; +package org.nl.utils; import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONObject; @@ -24,6 +24,7 @@ import net.dreamlu.mica.ip2region.core.IpInfo; import nl.basjes.parse.useragent.UserAgent; import nl.basjes.parse.useragent.UserAgentAnalyzer; import org.nl.modules.common.config.ElAdminProperties; +import org.nl.modules.common.utils.ElAdminConstant; import org.nl.modules.wql.util.SpringContextHolder; import javax.servlet.http.HttpServletRequest; diff --git a/mes/qd/src/store/modules/user.js b/mes/qd/src/store/modules/user.js index 3b1c7fb8..1a6cc9dc 100644 --- a/mes/qd/src/store/modules/user.js +++ b/mes/qd/src/store/modules/user.js @@ -83,10 +83,12 @@ export const logOut = (commit) => { export const setUserInfo = (res, commit) => { // 如果没有任何权限,则赋予一个默认的权限,避免请求死循环 - if (res.roles.length === 0) { + if (res.roles && res.roles.length > 0) { + commit('SET_ROLES', res.roles) + } else if (res.permissions.length === 0) { commit('SET_ROLES', ['ROLE_SYSTEM_DEFAULT']) } else { - commit('SET_ROLES', res.roles) + commit('SET_ROLES', res.permissions) } commit('SET_USER', res.user) }