如何修复这个错误?我正在使用超集来反应应用程序

问题描述 投票:0回答:1

我正在尝试将超集集成到我的应用程序中,但我不能,因为我遇到了这个错误,该错误与框架有关,而我在代码中没有使用框架,这是代码:

import { useSelector } from "react-redux";
import { authSelector } from "../../../redux/slices/auth";
import { embedDashboard } from "@superset-ui/embedded-sdk";
import { useEffect } from "react";

function SupersetDashboard({ token }) {
  const { company } = useSelector(authSelector);

  useEffect(() => {
    if (!token) return;
    embedDashboard({
      id: "49271a6d-182b-4761-9e6c-bf2c51bd1be2",
      supersetDomain: "https://dashboard.munjz.com/",
      mountPoint: document.getElementById("superset-iframe"),
      fetchGuestToken: () => token,
      dashboardUiConfig: {
        hideTitle: true,
        hideChartControls: true,
        hideTab: true,
      },
      rls: [{ clause: `company_id = ${company.id}` }],
    });
  }, []);

  return <div id="superset-iframe"></div>;
}

export default SupersetDashboard;

这是错误:

Refused to display 'https://dashboard.munjz.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

这是为了在我的网页中显示数据

javascript reactjs dom apache-superset
1个回答
0
投票

您可能会在这里找到解决方案

© www.soinside.com 2019 - 2024. All rights reserved.