Initial commit
This commit is contained in:
+110
@@ -0,0 +1,110 @@
|
||||
/** init domain config */
|
||||
// import './config'
|
||||
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import Storage from 'vue-ls'
|
||||
import router from './router'
|
||||
import store from './store/'
|
||||
import {
|
||||
VueAxios
|
||||
} from '@/utils/request'
|
||||
|
||||
import Antd, { version } from 'ant-design-vue'
|
||||
|
||||
// import Viser from 'viser-vue'
|
||||
import 'ant-design-vue/dist/antd.less' // or 'ant-design-vue/dist/antd.less'
|
||||
|
||||
import VueI18n from 'vue-i18n'
|
||||
import LangENUS from './common/lang/en-us'
|
||||
import LangZHCN from './common/lang/zh-cn'
|
||||
|
||||
import '@/permission' // permission control
|
||||
|
||||
// import '@/utils/filter' // base filtermybatis-plus
|
||||
// TODO 为什么要用2个图片预览的工具?
|
||||
// import preview from 'vue-photo-preview'
|
||||
// import 'vue-photo-preview/dist/skin.css'
|
||||
|
||||
import Viewer from 'v-viewer'
|
||||
import 'viewerjs/dist/viewer.css'
|
||||
import SSO from '@/cas/sso.js'
|
||||
import {
|
||||
ACCESS_TOKEN,
|
||||
DEFAULT_COLOR,
|
||||
DEFAULT_THEME,
|
||||
DEFAULT_LAYOUT_MODE,
|
||||
DEFAULT_COLOR_WEAK,
|
||||
SIDEBAR_TYPE,
|
||||
DEFAULT_FIXED_HEADER,
|
||||
DEFAULT_FIXED_HEADER_HIDDEN,
|
||||
DEFAULT_FIXED_SIDEMENU,
|
||||
DEFAULT_CONTENT_WIDTH_TYPE,
|
||||
DEFAULT_MULTI_PAGE
|
||||
} from '@/store/mutation-types'
|
||||
import config from '@/defaultSettings'
|
||||
|
||||
import hasPermission from '@/utils/hasPermission'
|
||||
|
||||
import JeroComponents from '@/components/jero/index'
|
||||
|
||||
import JDictComponenets from '@comp/dict/index.js'
|
||||
|
||||
console.log('ant-design-vue version:', version)
|
||||
// Vue.prototype.rules = rules
|
||||
Vue.config.productionTip = false
|
||||
Vue.use(Storage, config.storageOptions)
|
||||
Vue.use(Antd)
|
||||
Vue.use(VueAxios, router)
|
||||
|
||||
Vue.use(hasPermission)
|
||||
Vue.use(VueI18n)
|
||||
Vue.use(Viewer)
|
||||
Vue.use(JeroComponents)
|
||||
Vue.use(JDictComponenets)
|
||||
Viewer.setDefaults({
|
||||
// 需要配置的属性 注意属性并没有引号
|
||||
title: false,
|
||||
toolbar: false
|
||||
})
|
||||
|
||||
const i18n = new VueI18n({
|
||||
locale: 'zh-cn',
|
||||
messages: {
|
||||
'en-us': LangENUS,
|
||||
'zh-cn': LangZHCN
|
||||
}
|
||||
})
|
||||
|
||||
SSO.init(() => {
|
||||
main()
|
||||
})
|
||||
|
||||
Vue.prototype.global = {
|
||||
emptyLine: '—'
|
||||
}
|
||||
|
||||
function main () {
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
i18n,
|
||||
mounted () {
|
||||
store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true))
|
||||
store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme))
|
||||
store.commit('TOGGLE_LAYOUT_MODE', Vue.ls.get(DEFAULT_LAYOUT_MODE, config.layout))
|
||||
store.commit('TOGGLE_FIXED_HEADER', Vue.ls.get(DEFAULT_FIXED_HEADER, config.fixedHeader))
|
||||
store.commit('TOGGLE_FIXED_SIDERBAR', Vue.ls.get(DEFAULT_FIXED_SIDEMENU, config.fixSiderbar))
|
||||
store.commit('TOGGLE_CONTENT_WIDTH', Vue.ls.get(DEFAULT_CONTENT_WIDTH_TYPE, config.contentWidth))
|
||||
store.commit('TOGGLE_FIXED_HEADER_HIDDEN', Vue.ls.get(DEFAULT_FIXED_HEADER_HIDDEN, config.autoHideHeader))
|
||||
store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak))
|
||||
store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
|
||||
store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))
|
||||
store.commit('SET_MULTI_PAGE', Vue.ls.get(DEFAULT_MULTI_PAGE, config.multipage))
|
||||
},
|
||||
render: h => h(App),
|
||||
data: {
|
||||
Bus: new Vue()
|
||||
}
|
||||
}).$mount('#app')
|
||||
}
|
||||
Reference in New Issue
Block a user