镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-06 06:26:47 +00:00
添加了一个检查path的工具
这个提交包含在:
19
toolbox.py
19
toolbox.py
@@ -527,3 +527,22 @@ class DummyWith():
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
return
|
||||
|
||||
def custom_path_check(path: str)->bool:
|
||||
'''
|
||||
check path for sub url
|
||||
|
||||
path: path to check
|
||||
|
||||
return value: do sub url wrap
|
||||
'''
|
||||
if len(path) == 0:
|
||||
print("ilegal custom path: {}\npath must not be empty\ndeploy on root url".format(path))
|
||||
return False
|
||||
if path[0] == '/':
|
||||
if path[1] != '/':
|
||||
print("deploy on sub-path {}".format(path))
|
||||
return True
|
||||
return False
|
||||
print("ilegal custom path: {}\npath should begin with \'/\'\ndeploy on root url".format(path))
|
||||
return False
|
||||
|
||||
在新工单中引用
屏蔽一个用户