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

for test

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