You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
911 B

#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@Date:2022/08/01 17:04:40
'''
from operator import index
import sys
sys.path.append('.')
from flask import Blueprint, request, g
from db_logic.module_relation import BllModuleRelation
from Common.Utils import Utils
power_router = Blueprint('power', __name__)
@power_router.route("/user_power", methods=["GET", "POST"])
def get_user_power_list():
user_info = g.current_user
module_list = BllModuleRelation().get_user_module_list(user_id=user_info.user_id, role_id=user_info.role_id)
module_list = Utils.msyql_table_model(module_list)
if len(module_list) > 6:
for module in module_list:
if module["module_code"] == "DataReport":
if module_list.index(module) in [1,2,4]:
module_list.pop(module_list.index(module))
module_list.insert(5, module)
data = module_list