You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.7 KiB

import Vue from 'vue'
1 year ago
import { getQueryParam } from '@/utils'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import '@/styles/element-variables.scss'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import '@/styles/index.scss' // global css
import '@/styles/iconfont.css'
import App from './App'
import store from './store'
import router from './router'
import '@/icons' // icon
import '@/permission' // permission control
4 months ago
import ViewUI from 'view-design'
import './styles/viewui-mine.less'
Vue.use(ViewUI)
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
* you can execute: mockXHR()
*
* Currently MockJs will be used in the production environment,
* please remove it before going online ! ! !
*/
4 months ago
// if (process.env.NODE_ENV === 'production') {
// const { mockXHR } = require('../mock')
// mockXHR()
// }
// set ElementUI lang to EN
4 months ago
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui按如下方式声明
Vue.use(ElementUI)
4 months ago
import lxHeader from '@/components/LxHeader'
Vue.component('lx-header', lxHeader)
import xyTable from '@/components/XyTable'
Vue.component('xy-table', xyTable)
import xyDialog from '@/components/XyDialog'
Vue.component('xy-dialog', xyDialog)
import xySelectors from '@/components/XySelectors'
Vue.component('xy-selectors', xySelectors)
Vue.config.productionTip = false
import moment from 'moment'
4 months ago
Vue.prototype.$moment = moment
4 months ago
Vue.prototype.$integrateData = (target, value) => {
for (const i in target) {
if (target.hasOwnProperty(i) && value.hasOwnProperty(i)) {
target[i] = value[i]
}
}
}
4 months ago
window.$router = router
4 months ago
import { setToken, getToken } from '@/utils/auth'
if (window.top !== window.self) {
1 year ago
// 当前页面在iframe中
4 months ago
window._IN_IFRAME = true
1 year ago
Vue.config.errorHandler = (err, vm, info) => {
4 months ago
try {
if (typeof top !== 'undefined' && top && typeof top._addError === 'function') {
top._addError(err.message, err.stack)
}
} catch (e) {
console.warn('Error logging failed:', e)
}
1 year ago
console.error(err)
}
1 year ago
}
1 year ago
if (window.__POWERED_BY_WUJIE__) {
4 months ago
let instance
1 year ago
window.__WUJIE_MOUNT = () => {
instance = new Vue({
router,
store,
render: h => h(App)
4 months ago
}).$mount('#app')
window.MODULE_NAME = window.$wujie?.props?.module_name
console.log('token-wujie', window.MODULE_NAME)
1 year ago
setToken(window.$wujie?.props?.auth_token)
router.push('/')
4 months ago
}
1 year ago
window.__WUJIE_UNMOUNT = () => {
4 months ago
instance.$destroy()
}
1 year ago
} else {
window.MODULE_NAME = getQueryParam('module_name')
1 year ago
new Vue({
router,
store,
render: h => h(App)
4 months ago
}).$mount('#app')
1 year ago
}