/** @format */

import Vue from "vue";
import App from "./App";
import store from "./store"; // store
import plugins from "./plugins"; // plugins
import "./permission"; // permission
import uView from "@/uni_modules/uview-ui";
import config from "./config";

Vue.use(plugins);

Vue.config.productionTip = false;
Vue.prototype.$store = store;

App.mpType = "app";

const app = new Vue({
	...App,
});
window.previewPdf = (pre) => {
	console.log(pre)
	let path = 'http://im.hebjlzy.com/api/system/sys-file/download?bucket=local&path=' + pre
	uni.downloadFile({
		url: path,
		success: (res) => {
			var filePath = res.tempFilePath;
			uni.openDocument({
				filePath: filePath,
				showMenu: true,
				success: function(res) {
					console.log('打开文档成功');
				}
			});
		}
	})

}
Vue.prototype.$baseUrl = config.baseUrl;
// main.js
Vue.use(uView);

app.$mount();