Commit 345e5e37 authored by liangfenglong's avatar liangfenglong

更新

parent 7f0f13f2
...@@ -5,7 +5,7 @@ LIVE_USER = { ...@@ -5,7 +5,7 @@ LIVE_USER = {
'password': 'a123456' 'password': 'a123456'
} }
LIVE_WATCHER = { LIVE_WATCHER = {
'phone': '13608913121', 'phone': '18855556666',
'password': 'a123456' 'password': 'a123456'
} }
HERA_SESSION = 'tm115sjlt2nzimgxfa34c91xghvor1ue' HERA_SESSION = 'tm115sjlt2nzimgxfa34c91xghvor1ue'
......
...@@ -19,7 +19,7 @@ class LoginFailedException(Exception): ...@@ -19,7 +19,7 @@ class LoginFailedException(Exception):
# 支持更换用户 # 支持更换用户
def require_login(arg=None, **user_dict): def require_login(user_dict):
''' '''
依然使用requests,只不过在使用过程中被替换成了gmhttp 依然使用requests,只不过在使用过程中被替换成了gmhttp
:param func: :param func:
...@@ -31,7 +31,7 @@ def require_login(arg=None, **user_dict): ...@@ -31,7 +31,7 @@ def require_login(arg=None, **user_dict):
def _inner(*args, **kwargs): def _inner(*args, **kwargs):
# 哈哈,不知道写啥 # 哈哈,不知道写啥
try: try:
newhttp = _Gmhttp.instance(**user_dict) newhttp = _Gmhttp.instance(**user_dict_n)
except LoginFailedException: except LoginFailedException:
# 登录失败后,使用无登录状态尝试访问 # 登录失败后,使用无登录状态尝试访问
return func(*args, **kwargs) return func(*args, **kwargs)
...@@ -52,8 +52,10 @@ def require_login(arg=None, **user_dict): ...@@ -52,8 +52,10 @@ def require_login(arg=None, **user_dict):
return _inner return _inner
# 为了兼容@require_login 直接使用 # 为了兼容@require_login 直接使用
if callable(arg): if callable(user_dict):
return outer(arg) user_dict_n = {}
return outer(user_dict)
user_dict_n = user_dict
return outer return outer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment