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.

37 lines
1.1 KiB

#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@Date:2022/08/01 17:04:40
'''
import sys
sys.path.append('.')
from db_logic.user import BllUser
from Common.auth import token_auth
from flask import Blueprint, jsonify, 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"])
@token_auth.login_required
def get_user_power_list():
user_info = g.current_user
# user_id = '4cea74ee-0d8b-11ed-943e-f47b094925e1'
# user_info = BllUser().findEntity(user_id)
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)
return jsonify(Utils.true_return(data=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