|
|
|
|
|
import Vue from 'vue'
|
|
|
|
|
|
import { getQueryParam } from '@/utils'
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 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 ! ! !
|
|
|
|
|
|
*/
|
|
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
|
|
|
const { mockXHR } = require('../mock')
|
|
|
|
|
|
mockXHR()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// set ElementUI lang to EN
|
|
|
|
|
|
//Vue.use(ElementUI, { locale })
|
|
|
|
|
|
// 如果想要中文版 element-ui,按如下方式声明
|
|
|
|
|
|
Vue.use(ElementUI)
|
|
|
|
|
|
import VxeTable from 'vxe-table'
|
|
|
|
|
|
//import { VxeButton, VxeIcon, VxeTable, VxeColumn, VxeColgroup, VxeModal, VxeToolbar, VxeTableEditModule, VxeTableValidatorModule, VxeTableExportModule } from "vxe-table";
|
|
|
|
|
|
import "vxe-table/styles/index.scss"
|
|
|
|
|
|
Vue.use(VxeTable)
|
|
|
|
|
|
// Vue.use(VxeTableEditModule);
|
|
|
|
|
|
// Vue.use(VxeTableValidatorModule);
|
|
|
|
|
|
// Vue.use(VxeTableExportModule);
|
|
|
|
|
|
// Vue.use(VxeIcon);
|
|
|
|
|
|
// Vue.use(VxeTable);
|
|
|
|
|
|
// Vue.use(VxeColumn);
|
|
|
|
|
|
// Vue.use(VxeColgroup);
|
|
|
|
|
|
// Vue.use(VxeModal);
|
|
|
|
|
|
// Vue.use(VxeToolbar);
|
|
|
|
|
|
// Vue.use(VxeButton);
|
|
|
|
|
|
|
|
|
|
|
|
Vue.config.productionTip = false
|
|
|
|
|
|
|
|
|
|
|
|
//vant
|
|
|
|
|
|
import Vant from 'vant'
|
|
|
|
|
|
import 'vant/lib/index.css';
|
|
|
|
|
|
Vue.use(Vant)
|
|
|
|
|
|
|
|
|
|
|
|
import CardContainer from '@/layout/CardContainer.vue'
|
|
|
|
|
|
Vue.component('CardContainer', CardContainer)
|
|
|
|
|
|
//moment
|
|
|
|
|
|
import moment from 'moment'
|
|
|
|
|
|
Vue.prototype.$moment = moment;
|
|
|
|
|
|
|
|
|
|
|
|
import { setToken,getToken } from "@/utils/auth"
|
|
|
|
|
|
if (window.__POWERED_BY_WUJIE__) {
|
|
|
|
|
|
let instance;
|
|
|
|
|
|
window.__WUJIE_MOUNT = () => {
|
|
|
|
|
|
instance = new Vue({
|
|
|
|
|
|
router,
|
|
|
|
|
|
store,
|
|
|
|
|
|
render: h => h(App)
|
|
|
|
|
|
}).$mount("#app")
|
|
|
|
|
|
window.MODULE_NAME = window.$wujie?.props?.module_name;
|
|
|
|
|
|
console.log('token-wujie',window.MODULE_NAME)
|
|
|
|
|
|
setToken(window.$wujie?.props?.auth_token)
|
|
|
|
|
|
router.push('/')
|
|
|
|
|
|
};
|
|
|
|
|
|
window.__WUJIE_UNMOUNT = () => {
|
|
|
|
|
|
instance.$destroy();
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
else if(window.top !== window.self) {
|
|
|
|
|
|
// 当前页面在iframe中
|
|
|
|
|
|
window._IN_IFRAME = true;
|
|
|
|
|
|
|
|
|
|
|
|
setToken(window.decodeURIComponent(getQueryParam('auth_token')))
|
|
|
|
|
|
window.MODULE_NAME = getQueryParam('module_name')
|
|
|
|
|
|
new Vue({
|
|
|
|
|
|
router,
|
|
|
|
|
|
store,
|
|
|
|
|
|
render: h => h(App)
|
|
|
|
|
|
}).$mount("#app")
|
|
|
|
|
|
router.push(getQueryParam('to') || '/')
|
|
|
|
|
|
// window.addEventListener("message",function (e) {
|
|
|
|
|
|
// const { module_name, auth_token } = e.data;
|
|
|
|
|
|
// window.MODULE_NAME = module_name;
|
|
|
|
|
|
// console.log('token',auth_token)
|
|
|
|
|
|
//
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
new Vue({
|
|
|
|
|
|
router,
|
|
|
|
|
|
store,
|
|
|
|
|
|
render: h => h(App)
|
|
|
|
|
|
}).$mount("#app")
|
|
|
|
|
|
}
|