vue2-client 1.2.25 → 1.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/request.js +2 -1
- package/src/utils/routerUtil.js +6 -0
package/package.json
CHANGED
package/src/utils/request.js
CHANGED
|
@@ -113,9 +113,10 @@ function loadInterceptors () {
|
|
|
113
113
|
// 让每个请求携带自定义 token 请根据实际情况自行修改
|
|
114
114
|
if (token) {
|
|
115
115
|
config.headers['Access-Token'] = token
|
|
116
|
+
config.headers['Cookie'] = Cookie
|
|
116
117
|
}
|
|
117
118
|
if (!config.headers['Content-Type']) {
|
|
118
|
-
config.headers['Content-Type'] = 'application/json;charset=UTF-8'
|
|
119
|
+
config.headers['Content-Type'] = 'application/json/x-www-form-urlencoded;charset=UTF-8'
|
|
119
120
|
}
|
|
120
121
|
return config
|
|
121
122
|
}, errorHandler)
|
package/src/utils/routerUtil.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
1
2
|
import routerMap from '@vue2-client/router/async/router.map'
|
|
2
3
|
import { mergeI18nFromRoutes } from '@vue2-client/utils/i18n'
|
|
3
4
|
import Router from 'vue-router'
|
|
@@ -135,6 +136,11 @@ function loadRoutes (routesConfig) {
|
|
|
135
136
|
// 应用配置
|
|
136
137
|
const { router, store, i18n } = appOptions
|
|
137
138
|
|
|
139
|
+
// 刷新页面时,有些全局状态丢失,在此处从本地缓存拿出来赋值
|
|
140
|
+
if (JSON.stringify(Vue.$login.f) == '{}') {
|
|
141
|
+
const login = store.getters['account/login']
|
|
142
|
+
Object.assign(Vue.$login, login)
|
|
143
|
+
}
|
|
138
144
|
// 如果 routesConfig 有值,则更新到本地,否则从本地获取
|
|
139
145
|
if (routesConfig) {
|
|
140
146
|
store.commit('account/setRoutesConfig', routesConfig)
|