- 业务源码统一迁入 src/,H5 模板移到 public/index.html - 新增 @vue/cli 4.5 + @dcloudio 2.0.2-5020620260917001 全套依赖与 scripts - 保留 vue.config.js 的 ROUTES 注入(uni-simple-router 运行时依赖) - 新增 scripts/node-compat.cjs 兼容 Node 23+ 移除的 util.isRegExp 等 API - README 补充构建/运行/回退说明
39 lines
847 B
JavaScript
39 lines
847 B
JavaScript
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
|
|
} |