file_preview.html 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
  6. <title>文件预览</title>
  7. <script src="https://office.jinjianghc.com/web-apps/apps/api/documents/api.js"></script>
  8. </head>
  9. <body id="preview">
  10. </body>
  11. <script>
  12. let title = '{$title}',url = '{$url}';
  13. const index = title.lastIndexOf('.');
  14. const fileType = title.substr(index + 1);
  15. const config = {
  16. "document": {
  17. "permissions": {
  18. comment: false,
  19. fillForms: false,
  20. "edit": false,
  21. },
  22. "fileType": fileType,
  23. "title": title,
  24. "url": url,
  25. // "key": this.md5,
  26. "lang": "zh-CN"
  27. },
  28. "width": '100%',
  29. "editorConfig": {
  30. mode: 'view',
  31. "lang": "zh-CN"
  32. }
  33. };
  34. document.title = title;
  35. const docEditor = new window.DocsAPI.DocEditor("preview", config);
  36. </script>
  37. </html>