From 8244a295d87202d7c0a0e61e13b1039329d5fef8 Mon Sep 17 00:00:00 2001 From: shenshuo <191715030@qq.com> Date: Mon, 15 Jul 2024 18:21:06 +0800 Subject: [PATCH] =?UTF-8?q?2024=E5=B9=B47=E6=9C=8815=E6=97=A5=20=20feat(Op?= =?UTF-8?q?enConfHandler)=E4=BC=98=E5=8C=96=E6=9C=8D=E5=8A=A1=E5=BC=80?= =?UTF-8?q?=E6=94=BE=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mg/handlers/login_v5_handler.py | 8 +++++--- mg/handlers/sys_mg_v4_handler.py | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/mg/handlers/login_v5_handler.py b/mg/handlers/login_v5_handler.py index 68c7a40..6e756a3 100644 --- a/mg/handlers/login_v5_handler.py +++ b/mg/handlers/login_v5_handler.py @@ -6,17 +6,19 @@ role : 用户登录 """ +import base64 import json import logging -import pyotp -import base64 from abc import ABC + +import pyotp from tornado.web import RequestHandler from websdk2.jwt_token import AuthToken + from libs.base_handler import BaseHandler -from services.sys_service import get_sys_conf_dict_for_me from services.login_service import update_login_ip, base_verify, ldap_verify, feishu_verify, uc_verify, \ generate_token, get_user_info_for_id +from services.sys_service import get_sys_conf_dict_for_me class LoginHandler(RequestHandler, ABC): diff --git a/mg/handlers/sys_mg_v4_handler.py b/mg/handlers/sys_mg_v4_handler.py index ff7ff1b..9b71faa 100644 --- a/mg/handlers/sys_mg_v4_handler.py +++ b/mg/handlers/sys_mg_v4_handler.py @@ -7,23 +7,25 @@ Desc : 应用相关逻辑 """ -import json -import shortuuid import base64 +import json from abc import ABC +from concurrent.futures import ThreadPoolExecutor + +import shortuuid from sqlalchemy import exc -from tornado.web import RequestHandler from tornado import gen from tornado.concurrent import run_on_executor -from concurrent.futures import ThreadPoolExecutor -from libs.base_handler import BaseHandler -from websdk2.db_context import DBContext +from tornado.web import RequestHandler from websdk2.base_handler import LivenessProbe +from websdk2.consts import const +from websdk2.db_context import DBContext from websdk2.jwt_token import gen_md5 -from websdk2.tools import check_password from websdk2.ldap import LdapApi from websdk2.model_utils import insert_or_update -from websdk2.consts import const +from websdk2.tools import check_password + +from libs.base_handler import BaseHandler from models.authority import Users, Menus, Functions, Components, Roles from services.audit_service import get_opt_log_list_v4 from services.sys_service import settings_add, get_sys_conf_dict, get_sys_open_conf_dict, init_email @@ -208,12 +210,12 @@ def post(self, *args, **kwargs): return self.write(res) -class OpenConfHandler(BaseHandler, ABC): +class OpenConfHandler(RequestHandler, ABC): def get(self): # 通用数据 - res = get_sys_open_conf_dict(**self.params) - return self.write(res) + res = get_sys_open_conf_dict() + self.write(res) class CheckSettingsHandler(BaseHandler, ABC): @@ -255,7 +257,7 @@ def post(self, *args, **kwargs): sys_mg_v4_urls = [ (r"/v4/app/opt_log/", LogV4Handler, {"handle_name": "PAAS管理-操作日志V4"}), - (r"/v4/na/conf/", OpenConfHandler, {"handle_name": "PAAS管理-开放配置"}), + (r"/v4/na/conf/", OpenConfHandler), # PAAS管理-开放配置v4 (r'/v4/sysconfig/settings/', AppSettingsHandler, {"handle_name": "PAAS管理-系统设置", "method": ["ALL"]}), (r'/v4/sysconfig/check/', CheckSettingsHandler, {"handle_name": "PAAS管理-系统设置检查", "method": ["ALL"]}), (r'/v4/authority/register/', AuthorityRegister, {"handle_name": "PAAS管理-权限注册", "method": ["ALL"]}),