提交 6db52d96 编写于 作者: guangjun.yang's avatar guangjun.yang

解决多个token问题

上级 d5abdc70
...@@ -99,8 +99,8 @@ export default { ...@@ -99,8 +99,8 @@ export default {
this.queryGDParams.regionId = cQuery.regionId || ''; this.queryGDParams.regionId = cQuery.regionId || '';
let hospitalIdList = cQuery.hospitalIdList || '' let hospitalIdList = cQuery.hospitalIdList || ''
this.queryGDParams.hospitalIdList = hospitalIdList && hospitalIdList.split(',') || []; this.queryGDParams.hospitalIdList = hospitalIdList && hospitalIdList.split(',') || [];
cookies.remove("token"); // cookies.remove("token");
cookies.set("token", cQuery.token || ''); cookies.set("lreporttoken", cQuery.token || '');
this.getGeneralExam(this.queryGDParams); this.getGeneralExam(this.queryGDParams);
} }
} }
......
...@@ -86,8 +86,8 @@ export default { ...@@ -86,8 +86,8 @@ export default {
this.queryGDParams.projectId = cQuery.projectId || ''; this.queryGDParams.projectId = cQuery.projectId || '';
this.queryGDParams.regionId = cQuery.regionId || ''; this.queryGDParams.regionId = cQuery.regionId || '';
this.queryGDParams.hospitalIdList = hospitalIdList && hospitalIdList.split(',') || []; this.queryGDParams.hospitalIdList = hospitalIdList && hospitalIdList.split(',') || [];
cookies.remove("token"); // cookies.remove("token");
cookies.set("token", cQuery.token || ''); cookies.set("lreporttoken", cQuery.token || '');
this.getGeneralExam(this.queryGDParams); this.getGeneralExam(this.queryGDParams);
} }
} }
......
...@@ -341,8 +341,8 @@ export default { ...@@ -341,8 +341,8 @@ 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.remove("token"); // cookies.remove("token");
cookies.set("token", this.token); cookies.set("lreporttoken", this.token);
this.setProjectId(this.projectId); this.setProjectId(this.projectId);
} else { } else {
this.getUserInfo(); this.getUserInfo();
...@@ -560,15 +560,22 @@ export default { ...@@ -560,15 +560,22 @@ export default {
}); });
// this.queryGDParams.hospitalIdList = hospitalIds // this.queryGDParams.hospitalIdList = hospitalIds
// 如果没有选择机构,则重新获取所有数据
this.isShowOrg = false;
this.orgName = this.shortName(hospitalNames[0] || '全部机构', 6);
if(hospitalIds.length == 0) {
this.getHospitalsCNT(this.CNTParams);
return;
}
this.queryGDParams.hospitalIdList = hospitalIds; this.queryGDParams.hospitalIdList = hospitalIds;
if (hospitalIds.length === 1) { if (hospitalIds.length === 1) {
this.isSingleOrg = hospitalIds.length === 1; // this.hospitalCnt = 1
this.isSingleOrg = true;
this.getGeneralPersonal(this.queryGDParams); this.getGeneralPersonal(this.queryGDParams);
} else { } else {
this.isSingleOrg = false;
this.getGeneralData(this.queryGDParams); this.getGeneralData(this.queryGDParams);
} }
this.isShowOrg = false;
this.orgName = this.shortName(hospitalNames[0] || '全部机构', 6);
this.getGeneralExam(this.queryGDParams); this.getGeneralExam(this.queryGDParams);
this.getUserAnalysis(this.queryGDParams); this.getUserAnalysis(this.queryGDParams);
this.getGeneralCourse(this.queryGDParams); this.getGeneralCourse(this.queryGDParams);
...@@ -640,8 +647,8 @@ export default { ...@@ -640,8 +647,8 @@ 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.remove("token"); // cookies.remove("token");
cookies.set("token", this.token); cookies.set("lreporttoken", this.token);
this.setUserToken(this.token); this.setUserToken(this.token);
this.setProjectId(this.projectId); this.setProjectId(this.projectId);
this.getProvinceData(this.queryParams); this.getProvinceData(this.queryParams);
......
...@@ -56,8 +56,8 @@ export default { ...@@ -56,8 +56,8 @@ export default {
this.queryGDParams.projectId = cQuery.projectId || ""; this.queryGDParams.projectId = cQuery.projectId || "";
this.queryGDParams.regionId = cQuery.regionId || ""; this.queryGDParams.regionId = cQuery.regionId || "";
this.queryGDParams.hospitalIdList = hospitalIdList && hospitalIdList.split(',') || []; this.queryGDParams.hospitalIdList = hospitalIdList && hospitalIdList.split(',') || [];
cookies.remove("token"); // cookies.remove("token");
cookies.set("token", cQuery.token || ""); cookies.set("lreporttoken", cQuery.token || "");
this.getStudyEffect(this.queryGDParams); this.getStudyEffect(this.queryGDParams);
} }
} }
......
...@@ -63,8 +63,8 @@ export default { ...@@ -63,8 +63,8 @@ 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.remove("token"); // cookies.remove("token");
cookies.set("token", cQuery.token || ""); cookies.set("lreporttoken", cQuery.token || "");
this.getStudyTimeData(this.queryGDParams); this.getStudyTimeData(this.queryGDParams);
} }
}, },
......
...@@ -77,8 +77,8 @@ export default { ...@@ -77,8 +77,8 @@ export default {
type: 3 type: 3
}] }]
} }
cookies.remove("token"); // cookies.remove("token");
cookies.set("token", cQuery.token || ''); cookies.set("lreporttoken", cQuery.token || '');
this.getStudyRankData(this.queryGDParams); this.getStudyRankData(this.queryGDParams);
console.log(this.queryGDParams) console.log(this.queryGDParams)
} }
......
...@@ -20,7 +20,7 @@ Axios.interceptors.request.use( ...@@ -20,7 +20,7 @@ Axios.interceptors.request.use(
if (method === 'post' || method === 'put' || method === 'delete') {} if (method === 'post' || method === 'put' || method === 'delete') {}
if (config.withCredentials) { if (config.withCredentials) {
// config.headers.token = '3EB9111164E84A45B5B00428D52BC966'; // config.headers.token = '3EB9111164E84A45B5B00428D52BC966';
config.headers.token = cookies.get('token') || '8F88F86408314155B6840723FAB7DAEC' || '299F66567E7C48C78ADE418B364C5A35' || 'F24CD42F1CFA46829639228E9CFE1E3D' || 'C284B868425D494386EAEF6C9AE99937'; config.headers.token = cookies.get('lreporttoken') || '8F88F86408314155B6840723FAB7DAEC' || '299F66567E7C48C78ADE418B364C5A35' || 'F24CD42F1CFA46829639228E9CFE1E3D' || 'C284B868425D494386EAEF6C9AE99937';
} }
return config; return config;
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册