123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import App from "./App";
- // main.js
- import uView from "uview-ui";
- import api from "@/libs/http/index.js";
- import store from "./store";
- import VueI18n from "vue-i18n";
- Vue.use(VueI18n);
- Vue.prototype.$store = store;
- Vue.prototype.api = api; //(2)
- Vue.use(uView);
- import { throttle } from "@/libs/util/utils.js"; //防抖
- Vue.prototype.socketTask = null;
- Vue.prototype.isClose = false;
- const i18n = new VueI18n({
- locale: "en-US",
- messages: {
- "en-US": {
- index: {
- invite: "Invite",
- game: "Game",
- },
- },
- "zh-CN": {
- index: {
- invite: "邀请",
- game: "游戏",
- },
- },
- },
- });
- Vue.prototype._i18n = i18n;
- Vue.directive("throttle", throttle);
- // #ifndef VUE3
- import Vue from "vue";
- import { broadcastScan } from "@/utils/scanCode";
- // main.js
- // import "amfe-flexible";
- import inputSearch from "@/components/p-inputSearch/inputSearch.vue";
- Vue.component("inputSearch", inputSearch);
- Vue.prototype.apiServer = "http://192.168.1.45/dev-api";
- Vue.prototype.$broadcastScan = broadcastScan;
- Vue.prototype.ip = "192.168.1.45";
- Vue.config.productionTip = false;
- App.mpType = "app";
- uni.setStorage({
- key: "storage_token",
- data: "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjdjZWVjNGI2LWE2NGYtNDI3OS05MWEzLTAxMzdkNmEyNDdkNiJ9.7e2lVcZ0b3Y8ofwDCvrETpEZQETrp1Ik-MYfsufiMSoR7oqvI5XiXgbe2bVk4jOJGt7ns0ryKbp5XXE71hoXcA",
- success: function () {
- console.log("success");
- },
- });
- const app = new Vue({
- ...App,
- i18n,
- store,
- });
- app.$mount();
- // #endif
- // #ifdef VUE3
- import { createSSRApp } from "vue";
- export function createApp() {
- const app = createSSRApp(App);
- return {
- app,
- };
- }
- // #endif
|