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.
flyapps/fir_client/src/main.js

149 lines
2.7 KiB

import Vue from 'vue'
import App from "@/App";
import router from "@/router";
// import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import Vuex from 'vuex'
import qiniu from 'qiniu-js'
import oss from 'ali-oss'
// const qiniu = require('qiniu-js');
//
Vue.prototype.qiniu = qiniu;
Vue.prototype.oss = oss;
//使用vue-cookies
import VueCookies from 'vue-cookies'
Vue.use(VueCookies);
//导入全局的geetest.js
import './assets/gt'
//导入store实例
import store from "./store";
//全局导航守卫
router.beforeEach((to, from, next) => {
// ...
if (VueCookies.isKey('access_token')) {
let user = {
username: VueCookies.get('username'),
shop_cart_num: VueCookies.get('shop_cart_num'),
access_token: VueCookies.get('access_token'),
avatar: VueCookies.get('avatar'),
notice_num: VueCookies.get('notice_num')
};
5 years ago
store.dispatch('doUserinfo', user)
}
next()
});
Vue.config.productionTip = false;
import {
Button,
Select,
Table,
TableColumn,
Input,
DatePicker,
Container,
Aside,
Col,
Header,
Popover,
Main,
Dialog,
Checkbox,
CheckboxGroup,
Pagination,
Option,
Upload,
Tabs,
TabPane,
Form,
FormItem,
Divider,
Message,
Row,
ButtonGroup,
MessageBox,
Image,
Loading,
Tag,
Tooltip,
Switch,
Link,
BreadcrumbItem,
Slider,
DropdownMenu,
Dropdown,
Breadcrumb, Avatar, DropdownItem, RadioButton, RadioGroup, OptionGroup, Progress, Timeline, TimelineItem, Card
} from "element-ui";
Vue.use(Progress);
Vue.use(OptionGroup);
Vue.use(Link);
Vue.use(Timeline);
Vue.use(TimelineItem);
Vue.use(Card);
Vue.use(RadioButton);
Vue.use(RadioGroup);
Vue.use(Avatar);
Vue.use(DropdownItem);
Vue.use(BreadcrumbItem);
Vue.use(Slider);
Vue.use(DropdownMenu);
Vue.use(Dropdown);
Vue.use(Breadcrumb);
Vue.use(Input);
Vue.use(CheckboxGroup);
Vue.use(DatePicker);
Vue.use(Button);
Vue.use(ButtonGroup);
Vue.use(Container);
Vue.use(Aside);
Vue.use(Col);
Vue.use(Header);
Vue.use(Popover);
Vue.use(Main);
Vue.use(Dialog);
Vue.use(Checkbox);
Vue.use(Pagination);
Vue.use(Select);
Vue.use(Option);
Vue.use(Table);
Vue.use(TableColumn);
Vue.use(Upload);
Vue.use(Tabs);
Vue.use(TabPane);
Vue.use(Form);
Vue.use(FormItem);
Vue.use(Divider);
Vue.use(Row);
Vue.use(Image);
Vue.use(Loading);
Vue.use(Tag);
Vue.use(Tooltip);
Vue.use(Switch);
Vue.prototype.$message = Message;
// Vue.use(MessageBox);
Vue.prototype.$confirm = MessageBox.confirm;
// Vue.use(ElementUI);
Vue.use(Vuex);
new Vue({
render: h => h(App),
router,
store,
}).$mount('#app');