main.js 912 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /** @format */
  2. import Vue from "vue";
  3. import App from "./App";
  4. import store from "./store"; // store
  5. import plugins from "./plugins"; // plugins
  6. import "./permission"; // permission
  7. import uView from "@/uni_modules/uview-ui";
  8. import config from "./config";
  9. Vue.use(plugins);
  10. Vue.config.productionTip = false;
  11. Vue.prototype.$store = store;
  12. App.mpType = "app";
  13. const app = new Vue({
  14. ...App,
  15. });
  16. window.previewPdf = (pre) => {
  17. console.log(pre)
  18. let path = 'http://im.hebjlzy.com/api/system/sys-file/download?bucket=local&path=' + pre
  19. uni.downloadFile({
  20. url: path,
  21. success: (res) => {
  22. var filePath = res.tempFilePath;
  23. uni.openDocument({
  24. filePath: filePath,
  25. showMenu: true,
  26. success: function(res) {
  27. console.log('打开文档成功');
  28. }
  29. });
  30. }
  31. })
  32. }
  33. Vue.prototype.$baseUrl = config.baseUrl;
  34. // main.js
  35. Vue.use(uView);
  36. app.$mount();