From e27d169b72171cafb76bece4a2500e8e8fdd16bd Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Thu, 13 Jun 2024 10:39:27 +0800
Subject: [PATCH] 在公安安全监管模块,增加校园场所管理模块,在场所的展示的字段基础上,展示校园的基本信息,包括小程序校园主体账号场所维护里面的基本信息和学校信息

---
 src/store/modules/user.js |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 7fb5f2f..4105007 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -29,6 +29,10 @@
   }
 }
 
+function findChildrenRole(data, str) {
+  return data.split(",").find((item) => item == str);
+}
+
 function addPath(ele, first) {
   const menu = website.menu;
   const propsConfig = menu.props;
@@ -87,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);
@@ -97,7 +102,13 @@
 
               dispatch("GetMenu").then((menuData) => {
                 let fistMenu = findChildrenUrl(menuData);
-                if (data.role_name == "jdgly" || data.role_name == "sqgly") {
+                if (
+                  findChildrenRole(data.role_name, "admin") ||
+                  findChildrenRole(data.role_name, "administrator") ||
+                  findChildrenRole(data.role_name, "gagly") ||
+                  findChildrenRole(data.role_name, "jdgly") ||
+                  findChildrenRole(data.role_name, "sqgly")
+                ) {
                   setStore({ name: "showMenu", content: true });
 
                   commit("SET_HOMEFIRSTTAGPAGE", {
@@ -140,7 +151,7 @@
                   resolve({ fistMenu, menuData });
                 }
 
-                // commit("DEL_ALL_TAG");
+                commit("DEL_ALL_TAG");
               });
             }
           })

--
Gitblit v1.9.3