12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import App from './App'
- import Vue from 'vue'
- Vue.prototype.$token = false
- Vue.prototype.$userInfo = null
- uni.getStorage({
- key: "userInfo",
- success(_data) {
- Vue.prototype.$userInfo = _data.data
- },
- fail() {
- Vue.prototype.$userInfo = null
- }
- })
- Vue.prototype.$token = uni.getStorageSync('Authorization')
- //公用链接
- import env from '@/util/env.js'
- Vue.prototype.$baseUrl = env.baseUrl
- //公用请求
- import httpServer from "@/util/http.js"
- Vue.prototype.$get = httpServer.get
- Vue.prototype.$post = httpServer.post
- import w_md5 from "js_sdk/zww-md5/w_md5.js"
- Vue.prototype.$w_md5 = w_md5;
- import Mixin from './polyfill/mixins'
- Vue.mixin(Mixin)
- import VueI18n from 'vue-i18n';
- Vue.use(VueI18n)
- const i18n = new VueI18n({
- // #ifdef MP
- locale: 'zh-CN', //初始化,保证刷新页面也保留
- // #endif
- // #ifdef APP-PLUS
- locale: plus.storage.getItem('locale') || 'zh-CN', //初始化,保证刷新页面也保留
- // #endif
- // #ifdef H5
- locale: localStorage.getItem('locale') || 'zh-CN', //初始化,保证刷新页面也保留
- // #endif
- // 加载语言文件的内容
- messages: {
- 'zh-CN': require('./lang/cn.js').lang,
- 'en': require('./lang/en.js').lang
- }
- })
- Vue.config.productionTip = false
- App.mpType = 'app'
- const app = new Vue({
- i18n,
- ...App
- })
- app.$mount()
|