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.

94 lines
2.4 KiB

2 years ago
import Vue from 'vue'
2 years ago
import { getQueryParam } from '@/utils'
2 years ago
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'
import '@/icons' // icon
import '@/permission' // permission control
// set ElementUI lang to EN
2 years ago
//Vue.use(ElementUI, { locale })
2 years ago
// 如果想要中文版 element-ui按如下方式声明
2 years ago
Vue.use(ElementUI)
2 years ago
2 years ago
Vue.config.productionTip = false
// vant: only register components used as global tags
import { Popup, Picker, Uploader } from 'vant'
import 'vant/lib/popup/style'
import 'vant/lib/picker/style'
import 'vant/lib/uploader/style'
import 'vant/lib/checkbox/style'
import 'vant/lib/checkbox-group/style'
import 'vant/lib/dropdown-menu/style'
import 'vant/lib/dropdown-item/style'
Vue.use(Popup)
Vue.use(Picker)
Vue.use(Uploader)
2 years ago
import domZIndex from 'dom-zindex'
domZIndex.setCurrent(2000)
2 years ago
2 years ago
// treeselect
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import Treeselect from '@riophae/vue-treeselect'
Vue.component('Treeselect', Treeselect)
2 years ago
import CardContainer from '@/layout/CardContainer.vue'
Vue.component('CardContainer', CardContainer)
2 years ago
//moment
import moment from 'moment'
2 years ago
moment.locale('zh-cn')
2 years ago
Vue.prototype.$moment = moment;
2 years ago
import { VueJsonp } from 'vue-jsonp'
Vue.use(VueJsonp)
2 years ago
import { setToken,getToken } from "@/utils/auth"
2 years ago
if(window.top !== window.self) {
// 当前页面在iframe中
window._IN_IFRAME = true;
2 years ago
Vue.config.errorHandler = (err, vm, info) => {
top?._addError(err.message, err.stack)
console.error(err)
}
2 years ago
}
2 years ago
if (window.__POWERED_BY_WUJIE__) {
let instance;
window.__WUJIE_MOUNT = () => {
instance = new Vue({
router,
store,
2 years ago
render: h => h(App),
beforeCreate() {
Vue.prototype.$bus = this
}
2 years ago
}).$mount("#app")
window.MODULE_NAME = window.$wujie?.props?.module_name;
2 years ago
console.log('token-wujie',window.MODULE_NAME)
2 years ago
setToken(window.$wujie?.props?.auth_token)
router.push('/')
};
window.__WUJIE_UNMOUNT = () => {
instance.$destroy();
};
2 years ago
} else {
2 years ago
window.MODULE_NAME = getQueryParam('module_name')
new Vue({
router,
store,
2 years ago
render: h => h(App),
beforeCreate() {
Vue.prototype.$bus = this
}
2 years ago
}).$mount("#app")
2 years ago
}