fix: [api] fix crawler api

pull/586/head
Terrtia 2022-09-14 10:16:34 +02:00
parent 1254c1c9c0
commit bacedfe643
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 2 additions and 1 deletions

View File

@ -561,7 +561,8 @@ def get_crawled_domain_list():
@token_required('analyst') @token_required('analyst')
def add_crawler_task(): def add_crawler_task():
data = request.get_json() data = request.get_json()
user_id = get_user_from_token(token) user_token = get_auth_from_header()
user_id = get_user_from_token(user_token)
res = crawlers.api_add_crawler_task(data, user_id=user_id) res = crawlers.api_add_crawler_task(data, user_id=user_id)
if res: if res:
return create_json_response(res[0], res[1]) return create_json_response(res[0], res[1])