Skip to content

Commit

Permalink
2024年7月15日 feat(OpenConfHandler)优化服务开放配置
Browse files Browse the repository at this point in the history
  • Loading branch information
ss1917 committed Jul 15, 2024
1 parent 04afb47 commit 8244a29
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
8 changes: 5 additions & 3 deletions mg/handlers/login_v5_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
26 changes: 14 additions & 12 deletions mg/handlers/sys_mg_v4_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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"]}),
Expand Down

0 comments on commit 8244a29

Please sign in to comment.