浏览代码

修改报告详情中iframe地址

jwyu 8 月之前
父节点
当前提交
5abc95acd3
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 9 2
      src/views/report/Detail.vue

+ 9 - 2
src/views/report/Detail.vue

@@ -13,6 +13,7 @@ function getSystemConfig() {
   apiCommon.systemConfig().then(res => {
     if (res.Ret === 200) {
       systemConfig = res.Data
+      console.log(res.Data);
     }
   })
 }
@@ -60,17 +61,23 @@ async function getReportInfo() {
     await getUserInfo()
     if (res.Data.Status === 4) {
       if (userInfo.Status === 2 && userInfo.HasPermission === '私有权限') {
+        reportInfo.value.Content=modifyReportContentIframeData(reportInfo.value.Content)
         formatIframeData()
       }else{
-        reportContent.value = reportInfo.value.Content
+        reportContent.value = modifyReportContentIframeData(reportInfo.value.Content)
       }
     } else {//无权限
-      reportContent.value = reportInfo.value.ContentSub
+      reportContent.value = modifyReportContentIframeData(reportInfo.value.ContentSub)
     }
   }
 }
 getReportInfo()
 
+// 修改报告中嵌入的图表地址
+function modifyReportContentIframeData(str){
+  return str.replace(/http:\/\/eta.dwfutures.com:8001/g,'https://dwresearch.dwfutures.com')
+}
+
 // 给报告详情中图表加参数
 function formatIframeData() {
   reportContent.value = reportInfo.value.Content.replace(/\/chartshow\?code=/g, `/chartshow?source=etamini&token=${localStorage.getItem('token')}&reportId=${reportId}&code=`)