提交 ef4ec7c0 编写于 作者: 张磊's avatar 张磊

for test

上级 5fbaa593
import $http from 'mn-template/plugins/http'; import $http from 'mn-template/plugins/http';
import cookies from 'js-cookie';
$http.setDefaults({ $http.setDefaults({
headers: {}, headers: {},
}); });
...@@ -14,9 +13,6 @@ $http.setOptions({ ...@@ -14,9 +13,6 @@ $http.setOptions({
// 新增前置钩子 // 新增前置钩子
$http.addBeforeHook((config) => { $http.addBeforeHook((config) => {
console.log('我是新增的前置钩子', config); console.log('我是新增的前置钩子', config);
console.log('---', cookies.get('lreporttoken'));
config.headers.token = cookies.get('lreporttoken');
console.log('修改后----', config);
}, 0); }, 0);
// 新增后置钩子 // 新增后置钩子
......
...@@ -92,7 +92,7 @@ export default { ...@@ -92,7 +92,7 @@ export default {
const hospitalIdList = cQuery.hospitalIdList || ''; const hospitalIdList = cQuery.hospitalIdList || '';
this.queryGDParams.hospitalIdList = this.queryGDParams.hospitalIdList =
(hospitalIdList && hospitalIdList.split(',')) || []; (hospitalIdList && hospitalIdList.split(',')) || [];
cookies.set('lreporttoken', cQuery.token || ''); cookies.set('conslToken', cQuery.token || '');
this.queryGDParams.originalFlag = cQuery.originalFlag; this.queryGDParams.originalFlag = cQuery.originalFlag;
this.getGeneralExam(this.queryGDParams); this.getGeneralExam(this.queryGDParams);
} }
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
this.queryGDParams.regionId = cQuery.regionId || ''; this.queryGDParams.regionId = cQuery.regionId || '';
this.queryGDParams.hospitalIdList = this.queryGDParams.hospitalIdList =
(hospitalIdList && hospitalIdList.split(',')) || []; (hospitalIdList && hospitalIdList.split(',')) || [];
cookies.set('lreporttoken', cQuery.token || ''); cookies.set('conslToken', cQuery.token || '');
this.queryGDParams.originalFlag = cQuery.originalFlag; this.queryGDParams.originalFlag = cQuery.originalFlag;
this.getGeneralExam(this.queryGDParams); this.getGeneralExam(this.queryGDParams);
} }
......
...@@ -425,7 +425,7 @@ export default { ...@@ -425,7 +425,7 @@ export default {
this.queryParams.projectId = this.projectId; this.queryParams.projectId = this.projectId;
if (this.$rocNative.isWeb) { if (this.$rocNative.isWeb) {
this.setUserToken(this.token); this.setUserToken(this.token);
cookies.set('lreporttoken', this.token); cookies.set('conslToken', this.token);
this.setProjectId(this.projectId); this.setProjectId(this.projectId);
} else { } else {
this.getUserInfo(); this.getUserInfo();
...@@ -785,7 +785,7 @@ export default { ...@@ -785,7 +785,7 @@ export default {
this.$rocNative.getUserInfo && this.$rocNative.getUserInfo &&
this.$rocNative.getUserInfo().then((params) => { this.$rocNative.getUserInfo().then((params) => {
this.token = params.userToken; // 测试用时注释掉 this.token = params.userToken; // 测试用时注释掉
cookies.set('lreporttoken', this.token); cookies.set('conslToken', this.token);
this.setUserToken(this.token); this.setUserToken(this.token);
this.setProjectId(this.projectId); this.setProjectId(this.projectId);
this.getProjectInfo(this.queryParams); this.getProjectInfo(this.queryParams);
......
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
this.queryGDParams.regionId = cQuery.regionId || ''; this.queryGDParams.regionId = cQuery.regionId || '';
this.queryGDParams.hospitalIdList = this.queryGDParams.hospitalIdList =
(hospitalIdList && hospitalIdList.split(',')) || []; (hospitalIdList && hospitalIdList.split(',')) || [];
cookies.set('lreporttoken', cQuery.token || ''); cookies.set('conslToken', cQuery.token || '');
this.queryGDParams.originalFlag = cQuery.originalFlag; this.queryGDParams.originalFlag = cQuery.originalFlag;
this.getStudyEffect(this.queryGDParams); this.getStudyEffect(this.queryGDParams);
} }
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
if (process.client) { if (process.client) {
var _this = this; var _this = this;
if (this.$rocNative.isWeb) { if (this.$rocNative.isWeb) {
cookies.set('lreporttoken', _this.token); cookies.set('conslToken', _this.token);
_this.getProjectList(); _this.getProjectList();
} else { } else {
_this.getUserInfo(); _this.getUserInfo();
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
this.$rocNative.getUserInfo && this.$rocNative.getUserInfo &&
this.$rocNative.getUserInfo().then((params) => { this.$rocNative.getUserInfo().then((params) => {
this.token = params.userToken; this.token = params.userToken;
cookies.set('lreporttoken', this.token); cookies.set('conslToken', this.token);
this.getProjectList(); this.getProjectList();
}); });
}, },
......
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
this.queryGDParams.hospitalIdList = this.queryGDParams.hospitalIdList =
(hospitalIdList && hospitalIdList.split(',')) || []; (hospitalIdList && hospitalIdList.split(',')) || [];
// cookies.remove("token"); // cookies.remove("token");
cookies.set('lreporttoken', cQuery.token || ''); cookies.set('conslToken', cQuery.token || '');
this.queryGDParams.originalFlag = cQuery.originalFlag; this.queryGDParams.originalFlag = cQuery.originalFlag;
this.getStudyTimeData(this.queryGDParams); this.getStudyTimeData(this.queryGDParams);
} }
......
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
}, },
]; ];
} }
cookies.set('lreporttoken', cQuery.token || ''); cookies.set('conslToken', cQuery.token || '');
this.queryGDParams.originalFlag = cQuery.originalFlag; this.queryGDParams.originalFlag = cQuery.originalFlag;
this.getStudyRankData(this.queryGDParams); this.getStudyRankData(this.queryGDParams);
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册