import { BASE_URL, API_URL, IMG_URL } from '../env.js'; import http from '@/core/request'; import tools from '@/core/utils/tool'; import mixin from '@/core/mixins'; const install = Vue => { Vue.prototype.$BASE_URL = BASE_URL; Vue.prototype.$API_URL = API_URL; Vue.prototype.$IMG_URL = IMG_URL; // 挂载请求 Vue.prototype.$http = http; // 挂载工具函数 Vue.prototype.$tools = tools; Vue.mixin(mixin); } export async function init(options) { // #ifdef H5 platform.entry(); if(options.query && options.query.appid) // #endif // #ifdef MP-WEIXIN // 检测小程序更新(如果从朋友圈场景进入则无此API) options.scene !== 1154 && wechat.checkMiniProgramUpdate(); // #endif await store.dispatch("appInit", options); // 加载商城基本信息 // #ifdef MP-WEIXIN // #endif } export default { install }