mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 14:50:29 +00:00
Merge branch '8.0' into master
This commit is contained in:
@@ -2,7 +2,7 @@ Django==2.2.14
|
||||
future
|
||||
captcha
|
||||
django-statici18n
|
||||
django-webpack_loader
|
||||
django-webpack_loader==0.7.0
|
||||
gunicorn
|
||||
mysqlclient
|
||||
django-picklefield==2.1.1
|
||||
|
@@ -107,7 +107,7 @@ def get_onlyoffice_dict(request, username, repo_id, file_path, file_id='',
|
||||
'can_download': can_download,
|
||||
'username': username,
|
||||
'onlyoffice_force_save': ONLYOFFICE_FORCE_SAVE,
|
||||
'enable_watermark': ENABLE_WATERMARK and not can_edit,
|
||||
'enable_watermark': ENABLE_WATERMARK,
|
||||
}
|
||||
|
||||
if ONLYOFFICE_JWT_SECRET:
|
||||
|
@@ -45,7 +45,9 @@
|
||||
document.getElementById('office_form').submit();
|
||||
document.getElementById('office_frame').className = '';
|
||||
</script>
|
||||
{% if enable_watermark %}
|
||||
<script type="text/javascript" src="{{ MEDIA_URL }}js/watermark.js"></script>
|
||||
<script type="text/javascript">{% include "snippets/add_watermark.html" %}</script>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1127,7 +1127,7 @@ if HAS_OFFICE_CONVERTER:
|
||||
def add_office_convert_task(file_id, doctype, raw_path):
|
||||
payload = {'exp': int(time.time()) + 300, }
|
||||
token = jwt.encode(payload, seahub.settings.SECRET_KEY, algorithm='HS256')
|
||||
headers = {"Authorization": "Token %s" % token.decode()}
|
||||
headers = {"Authorization": "Token %s" % token}
|
||||
params = {'file_id': file_id, 'doctype': doctype, 'raw_path': raw_path}
|
||||
url = urljoin(OFFICE_CONVERTOR_ROOT, '/add-task')
|
||||
requests.get(url, params, headers=headers)
|
||||
@@ -1136,7 +1136,7 @@ if HAS_OFFICE_CONVERTER:
|
||||
def query_office_convert_status(file_id, doctype):
|
||||
payload = {'exp': int(time.time()) + 300, }
|
||||
token = jwt.encode(payload, seahub.settings.SECRET_KEY, algorithm='HS256')
|
||||
headers = {"Authorization": "Token %s" % token.decode()}
|
||||
headers = {"Authorization": "Token %s" % token}
|
||||
params = {'file_id': file_id, 'doctype': doctype}
|
||||
url = urljoin(OFFICE_CONVERTOR_ROOT, '/query-status')
|
||||
d = requests.get(url, params, headers=headers)
|
||||
@@ -1164,7 +1164,7 @@ if HAS_OFFICE_CONVERTER:
|
||||
url = urljoin(OFFICE_CONVERTOR_ROOT, '/get-converted-page')
|
||||
payload = {'exp': int(time.time()) + 300, }
|
||||
token = jwt.encode(payload, seahub.settings.SECRET_KEY, algorithm='HS256')
|
||||
headers = {"Authorization": "Token %s" % token.decode()}
|
||||
headers = {"Authorization": "Token %s" % token}
|
||||
params = {'static_filename': static_filename, 'file_id': file_id}
|
||||
try:
|
||||
ret = requests.get(url, params, headers=headers)
|
||||
|
Reference in New Issue
Block a user