From a3cb935c2e1d4ebf78957c1e2ea4d7dd18d7c185 Mon Sep 17 00:00:00 2001 From: nineven Date: Fri, 27 Mar 2020 19:31:06 +0800 Subject: [PATCH] =?UTF-8?q?vue=20=E5=A4=9A=E5=85=A5=E5=8F=A3=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_client/src/Download.vue | 80 +++++++++++++++++++++++++++++++ fir_client/src/download.js | 51 ++++++++++++++++++++ fir_client/src/router/download.js | 0 fir_client/vue.config.js | 0 4 files changed, 131 insertions(+) create mode 100644 fir_client/src/Download.vue create mode 100644 fir_client/src/download.js create mode 100644 fir_client/src/router/download.js create mode 100644 fir_client/vue.config.js diff --git a/fir_client/src/Download.vue b/fir_client/src/Download.vue new file mode 100644 index 0000000..f0f9c3c --- /dev/null +++ b/fir_client/src/Download.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/fir_client/src/download.js b/fir_client/src/download.js new file mode 100644 index 0000000..ab95435 --- /dev/null +++ b/fir_client/src/download.js @@ -0,0 +1,51 @@ +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' +const qiniu = require('qiniu-js'); +Vue.prototype.qiniu = qiniu; + +//使用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') + }; + store.dispatch('getUser', user) + } + next() + +}); + + +Vue.config.productionTip = false; + +Vue.use(ElementUI); +Vue.use(Vuex); + + +new Vue({ + render: h => h(App), + router, + store, +}).$mount('#app'); diff --git a/fir_client/src/router/download.js b/fir_client/src/router/download.js new file mode 100644 index 0000000..e69de29 diff --git a/fir_client/vue.config.js b/fir_client/vue.config.js new file mode 100644 index 0000000..e69de29