-
diff --git a/src/router/index.js b/src/router/index.js
index 758792a..abac19f 100755
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -1,6 +1,5 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
-// import Recommend from "views/recommend/Recommend.vue"
Vue.use(VueRouter)
@@ -8,10 +7,10 @@ const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(to) {
return VueRouterPush.call(this, to).catch(err => err)
}
+
//标题js
import getPageTitle from "@/utils/title-config";
-
const Index = () => import('views/index/index')
const Recommend = () => import('views/index/recommend/Recommend')
const Collect = () => import('views/index/collect/Collect')
@@ -105,7 +104,9 @@ const routes = [
]
const router = new VueRouter({
- mode: 'history',
+ // mode: 'history',
+ // mode: 'hash',
+ mode: process.env.NODE_ENV == "development" ? 'hash' : 'history',
base: process.env.BASE_URL,
routes
})
diff --git a/src/utils/request.js b/src/utils/request.js
index e729cf5..7077777 100755
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -30,6 +30,9 @@ service.interceptors.request.use(config => {
//注意使用token的时候需要引入cookie方法或者用本地localStorage等方法,推荐js-cookie
// config['headers']['authorization'] = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
// config['headers']['authorization'] = "661aiz52k5e6vqgmkxnz0wvbv8nciz8h"
+
+ if (process.env.NODE_ENV == "development") config['headers']['authorization'] = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
+
return config
}, error => {
Promise.reject(error)