From 7730d7e3544295031cd27273da80f8b527a66bdb Mon Sep 17 00:00:00 2001 From: apan Date: Fri, 5 Aug 2022 16:50:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/power/views.py | 7 +++++++ db_logic/module_relation.py | 3 +++ 2 files changed, 10 insertions(+) diff --git a/apps/power/views.py b/apps/power/views.py index 2711497..81d509f 100644 --- a/apps/power/views.py +++ b/apps/power/views.py @@ -85,6 +85,13 @@ def get_login_user_power_list(): module_list = Utils.msyql_table_model(module_list) return jsonify(Utils.true_return(data=module_list)) +# 获取角色标签列表 +@power_router.route("/get_role_name_list", methods=["GET", "POST"]) +@token_auth.login_required +def get_role_name_list(): + data_list = BllModuleRelation().get_role_name_list() + return jsonify(Utils.true_return(data=Utils.msyql_table_model(data_list))) + # 获取角色列表 @power_router.route("/get_list", methods=["GET", "POST"]) @token_auth.login_required diff --git a/db_logic/module_relation.py b/db_logic/module_relation.py index a968306..6d94767 100644 --- a/db_logic/module_relation.py +++ b/db_logic/module_relation.py @@ -71,6 +71,9 @@ class BllModuleRelation(Repository): """ return self.execute(sql_all).fetchall() + def get_role_name_list(self): + return self.execute("select role_id, role_name from rms_role").fetchall() + def get_role_module(self, page_param): sql_all = """ select