| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- import App from './App'
- import uView from "uview-ui";
- // #ifndef VUE3
- import Vue from 'vue'
- import './uni.promisify.adaptor'
- Vue.config.productionTip = false
- Vue.config.errorHandler = (err, vm, info) => {
- console.error('Vue全局错误:', err, info);
- };
- Vue.config.warnHandler = (msg, vm, trace) => {
- console.warn('Vue警告:', msg, trace);
- };
- // 组件同步注册(uni-app要求必须为静态字符串)
- import My_listbox from './components/My_listbox.vue';
- Vue.component("My_listbox", My_listbox);
- import My_search from './components/My_search.vue';
- Vue.component("My_search", My_search);
- import filtrate from './components/filtrate.vue';
- Vue.component("filtrate", filtrate);
- import appList from './components/appList.vue';
- Vue.component("appList", appList);
- import floatBut from './components/floatBut.vue';
- Vue.component("floatBut", floatBut);
- import slideshow from './components/slideshow.vue';
- Vue.component("slideshow", slideshow);
- import storeInfo from './components/storeInfo.vue';
- Vue.component("storeInfo", storeInfo);
- import my_form from './components/my_form.vue';
- Vue.component("my_form", my_form);
- import My_upload from './components/my-upload.vue';
- Vue.component("My_upload", My_upload);
- import bottomForm from './components/bottomForm.vue';
- Vue.component("bottomForm", bottomForm);
- import displayCell from './components/displayCell.vue';
- Vue.component("displayCell", displayCell);
- //挂载接口
- let isDev = process.env.NODE_ENV === 'development';
- const http = {};
- // #ifdef H5
- http.baseUrl = isDev ? "/apis1" : "/apis";
- http.socket = isDev ? "/socket1" : "/socket";
- // #endif
- // #ifndef H5
- http.baseUrl = isDev ? "http://61.164.207.46:8900" : "https://meida.cnyunl.com:888";
- http.socket = isDev ? "ws://61.164.207.46:8900" : "wss://meida.cnyunl.com:888";
- // #endif
- http.baseUrl = "https://meida.cnyunl.com:888";
- http.socket = "wss://meida.cnyunl.com:888";
- console.log("接口地址", http)
- import { ApiModel } from './utils/api'
- Vue.prototype.$Http = new ApiModel(http.baseUrl);
- Vue.use(uView);
- import { Login } from "./utils/login"
- Vue.prototype.$Login = new Login();
- Vue.prototype.$Http.wechatLogin = Vue.prototype.$Login.wechatLogin;
- Vue.prototype.$Http.autoLogin = Vue.prototype.$Login.autoLogin;
- // 登录延迟执行(不阻塞首屏渲染)
- setTimeout(() => {
- Vue.prototype.$Login.autoLogin().catch(err => {
- console.error('自动登录失败:', err);
- });
- }, 100);
- App.mpType = 'app'
- const app = new Vue({
- ...App
- })
- app.$mount()
- // #endif
- // #ifdef VUE3
- import { createSSRApp } from 'vue'
- export function createApp() {
- const app = createSSRApp(App)
- return {
- app
- }
- }
- // #endif
|