|
@@ -1,6 +1,7 @@
|
|
import Vue from 'vue'
|
|
import Vue from 'vue'
|
|
import App from './App'
|
|
import App from './App'
|
|
import store from '@/store'
|
|
import store from '@/store'
|
|
|
|
+import getConfig from '@/config'
|
|
Vue.config.productionTip = false
|
|
Vue.config.productionTip = false
|
|
|
|
|
|
App.mpType = 'app'
|
|
App.mpType = 'app'
|
|
@@ -9,16 +10,19 @@ Vue.use(uView)
|
|
|
|
|
|
let vuexStore = require("@/store/$u.mixin.js")
|
|
let vuexStore = require("@/store/$u.mixin.js")
|
|
Vue.mixin(vuexStore)
|
|
Vue.mixin(vuexStore)
|
|
-/*
|
|
|
|
-* 提示信息
|
|
|
|
-*/
|
|
|
|
-Vue.prototype.toashMsg = function (title) {
|
|
|
|
- title = title == undefined ? "系统繁忙" : title;
|
|
|
|
- uni.showToast({
|
|
|
|
- title:title,
|
|
|
|
- icon:'none',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+// 系统配置
|
|
|
|
+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]
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* 权限检查
|
|
* 权限检查
|
|
@@ -26,7 +30,6 @@ Vue.prototype.toashMsg = function (title) {
|
|
Vue.prototype.$hasPermissions = function (value) {
|
|
Vue.prototype.$hasPermissions = function (value) {
|
|
let isExist = false;
|
|
let isExist = false;
|
|
let permissionsStr = store.state.vuex_userData.permCodes;
|
|
let permissionsStr = store.state.vuex_userData.permCodes;
|
|
- // console.log(permissionsStr,'permissionsStr')
|
|
|
|
if (permissionsStr == undefined || permissionsStr == null) {
|
|
if (permissionsStr == undefined || permissionsStr == null) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -38,6 +41,17 @@ Vue.prototype.$hasPermissions = function (value) {
|
|
}
|
|
}
|
|
return isExist;
|
|
return isExist;
|
|
}
|
|
}
|
|
|
|
+/*
|
|
|
|
+* 提示信息
|
|
|
|
+*/
|
|
|
|
+Vue.prototype.toashMsg = function (title) {
|
|
|
|
+ title = title == undefined ? "系统繁忙" : title;
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title:title,
|
|
|
|
+ icon:'none'
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
const app = new Vue({
|
|
const app = new Vue({
|
|
store,
|
|
store,
|
|
...App
|
|
...App
|