소스 검색

报表中查询图表不传token

zhuth 6 년 전
부모
커밋
ad54dff2e0
3개의 변경된 파일7개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 2
      src/models/chartDesigner.js
  2. 3 2
      src/models/dashboardDesigner.js
  3. 2 2
      src/services/index.js

+ 2 - 2
src/models/chartDesigner.js

@@ -948,7 +948,7 @@ export default {
         },
         *getChartTableData(action, { select, call, put }) {
             try {
-                const { chartCode, chartType, chartOption, filters, inDashboard, dashboardCode } = action;
+                const { chartCode, chartType, chartOption, filters, inDashboard, dashboardCreatorCode } = action;
                 let columns = [];
                 let dataSource = [];
                 const TimeType = {
@@ -1067,7 +1067,7 @@ export default {
                         }));
                         const body = inDashboard ? {
                             chartId: chartCode,
-                            dashboardCreatorId: dashboardCode,
+                            dashboardCreatorId: dashboardCreatorCode,
                             filters: getBodyFilters(filters),
                             testPage: {
                                 pageNum: 1,

+ 3 - 2
src/models/dashboardDesigner.js

@@ -819,7 +819,7 @@ export default {
         },
         *exportToExcel(action, { select, take, put }) {
             const dashboardDesigner = yield select(state => state.dashboardDesigner);
-            const { code, name, filters, items } = dashboardDesigner;
+            const { code, name, filters, items, creatorCode } = dashboardDesigner;
             try {
                 yield put({ type: 'setField', name: 'loading', value: true });
 
@@ -842,7 +842,8 @@ export default {
                             chartCode, chartType, chartOption,
                             filters: getTrueFilters(item, filters),
                             inDashboard: true,
-                            dashboardCode: code
+                            dashboardCode: code,
+                            dashboardCreatorCode: creatorCode
                         });
                         yield take('chartDesigner/getChartTableData/@@end');
                         yield sync.then(tableData => {

+ 2 - 2
src/services/index.js

@@ -13,8 +13,8 @@ function debounce(option) {
     })
 }
 export function fetch(option) {
-    let { url, method, headers, body, timeout, allow, requestType, fileName } = option;
-    const token = token === false ? null : window.sessionStorage.getItem("token");
+    let { url, method, token : hasToken, headers, body, timeout, allow, requestType, fileName } = option;
+    const token = hasToken === false ? null : window.sessionStorage.getItem("token");
     return debounce({ url, method, body }).then(() => {
         // 除非特殊许可,Token不存在时不发送请求
         if(token || allow) {