From ebfc739bdbbc0dd0fccd0bf47b7d2d5397c3c511 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Fri, 22 Mar 2024 12:44:21 +0800
Subject: [PATCH] 轮播图片

---
 src/store/modules/user.js |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 7862508..9400031 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -29,8 +29,8 @@
   }
 }
 
-function findChildrenRole (data, str) {
-    return data.split(',').find(item => item == str)
+function findChildrenRole(data, str) {
+  return data.split(",").find((item) => item == str);
 }
 
 function addPath(ele, first) {
@@ -91,6 +91,7 @@
                 message: data.error_description,
                 type: "error",
               });
+              resolve({ error: "error" });
             } else {
               commit("SET_TOKEN", data.access_token);
               commit("SET_REFRESH_TOKEN", data.refresh_token);
@@ -101,7 +102,12 @@
 
               dispatch("GetMenu").then((menuData) => {
                 let fistMenu = findChildrenUrl(menuData);
-                if (findChildrenRole(data.role_name, "jdgly") ||findChildrenRole(data.role_name, "sqgly")) {
+                if (
+                  findChildrenRole(data.role_name, "admin") ||
+                  findChildrenRole(data.role_name, "administrator") ||
+                  findChildrenRole(data.role_name, "jdgly") ||
+                  findChildrenRole(data.role_name, "sqgly")
+                ) {
                   setStore({ name: "showMenu", content: true });
 
                   commit("SET_HOMEFIRSTTAGPAGE", {

--
Gitblit v1.9.3