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.

108 lines
2.8 KiB

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