perf: 优化菜单管理模块service层及异常处理
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
from config.constant import CommonConstant
|
||||
|
||||
|
||||
class StringUtil:
|
||||
"""
|
||||
字符串工具类
|
||||
@@ -29,3 +32,12 @@ class StringUtil:
|
||||
:return: 校验结果
|
||||
"""
|
||||
return string is None or len(string) == 0
|
||||
|
||||
@classmethod
|
||||
def is_http(cls, link: str):
|
||||
"""
|
||||
判断是否为http(s)://开头
|
||||
:param link: 链接
|
||||
:return: 是否为http(s)://开头
|
||||
"""
|
||||
return link.startswith(CommonConstant.HTTP) or link.startswith(CommonConstant.HTTPS)
|
||||
|
Reference in New Issue
Block a user