12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import Vue from 'vue'
- import App from './App'
- import store from '@/store'
- import getConfig from '@/config'
- Vue.config.productionTip = false
- App.mpType = 'app'
- import uView from "uview-ui"
- Vue.use(uView)
- let vuexStore = require("@/store/$u.mixin.js")
- Vue.mixin(vuexStore)
- // 系统配置
- Vue.prototype.$config = function (key) {
- const envText = {pro:'生产环境',dev:'开发环境',uat:'预发布环境'}
- const theme = getApp().globalData.theme
- const config = getConfig(theme)
- if(key == 'init'){
- let buildType = getApp().globalData.buildType
- let baseUrl = config[buildType+'_URL']
- getApp().globalData.baseUrl = baseUrl
- getApp().globalData.envTips = envText[buildType]
- }
- return config[key]
- }
- /**
- * 权限检查
- */
- Vue.prototype.$hasPermissions = function (value) {
- let isExist = false;
- let permissionsStr = store.state.vuex_userData.permCodes;
- // console.log(permissionsStr,'permissionsStr')
- if (permissionsStr == undefined || permissionsStr == null) {
- return false;
- }
- let has = permissionsStr.find(item => {
- return item == value
- })
- if (has) {
- isExist = true;
- }
- return isExist;
- }
- /*
- * 提示信息
- */
- Vue.prototype.toashMsg = function (title) {
- title = title == undefined ? "系统繁忙" : title;
- uni.showToast({
- title:title,
- icon:'none'
- })
- }
- const app = new Vue({
- store,
- ...App
- })
- app.$mount()
|