编写权限路由

This commit is contained in:
wcq 2023-02-09 10:54:20 +08:00
parent 535c71eb29
commit 296f80ec4a
2 changed files with 19 additions and 0 deletions

7
Exceptions/common.py Normal file
View File

@ -0,0 +1,7 @@
class ErrorException(Exception):
pass
# 这个错误类型可以直接将错误传递到前端,作为错误提示
class CommonException(Exception):
pass

12
Utils/AuthRuleUtils.py Normal file
View File

@ -0,0 +1,12 @@
from typing import List
def make_auth_rule_data(rule_id_list: List[int]) -> str:
auth_rule_data = "".join([str(item) for item in rule_id_list])
return auth_rule_data
def parse_auth_rule_data(auth_rule_data: str) -> List[int]:
rule_id_list = [int(item) for item in auth_rule_data.split(",")]
return rule_id_list