index.ejs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>大博客服系统</title>
  6. <% if (htmlWebpackPlugin.options.nodeModules) { %>
  7. <!-- Add `node_modules/` to global paths so `require` works properly in development -->
  8. <script>
  9. require('module').globalPaths.push('<%= htmlWebpackPlugin.options.nodeModules.replace(/\\/g, '\\\\') %>')
  10. </script>
  11. <% } %>
  12. </head>
  13. <body>
  14. <div id="app"></div>
  15. <!-- Set `__static` path to static files in production -->
  16. <% if (!process.browser) { %>
  17. <script>
  18. localStorage.clear();
  19. sessionStorage.clear();
  20. const { remote } = require('electron')
  21. const { Menu, MenuItem } = remote
  22. const menu = new Menu()
  23. menu.append(new MenuItem({label:'复制', role: 'copy' }));
  24. menu.append(new MenuItem({label:'粘贴', role: 'paste' }));
  25. menu.append(new MenuItem({label:'剪切', role: 'cut' }));
  26. menu.append(new MenuItem({ label:'全选', role: 'selectall' }));
  27. window.addEventListener('contextmenu', (e) => {
  28. e.preventDefault()
  29. menu.popup({ window: remote.getCurrentWindow() })
  30. }, false)
  31. if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
  32. </script>
  33. <% } %>
  34. <!-- webpack builds are automatically injected -->
  35. </body>
  36. </html>