diff --git a/osgraph-web/index.html b/osgraph-web/index.html index 0d72f52..62453f6 100644 --- a/osgraph-web/index.html +++ b/osgraph-web/index.html @@ -23,6 +23,11 @@ // 解决 Multiple instances of Three.js being imported.的 warning, 参考:https://yanyunfeng.com/article/2 window.__THREE__ = null; + diff --git a/osgraph-web/src/constants/log.ts b/osgraph-web/src/constants/log.ts new file mode 100644 index 0000000..ca10780 --- /dev/null +++ b/osgraph-web/src/constants/log.ts @@ -0,0 +1 @@ +export const SPAPOS = "a4378"; \ No newline at end of file diff --git a/osgraph-web/src/global.d.ts b/osgraph-web/src/global.d.ts new file mode 100644 index 0000000..ce974c0 --- /dev/null +++ b/osgraph-web/src/global.d.ts @@ -0,0 +1,3 @@ +interface Window { + Tracert: any; +} \ No newline at end of file diff --git a/osgraph-web/src/home/index.tsx b/osgraph-web/src/home/index.tsx index 1ff62c1..eb191f7 100644 --- a/osgraph-web/src/home/index.tsx +++ b/osgraph-web/src/home/index.tsx @@ -10,9 +10,17 @@ import { TUGRAPH_TECH, X_LAB_GITHUB, } from "../constants/links"; +import { SPAPOS } from "../constants/log"; import { getIsMobile } from "../utils/isMobile"; import styles from "./index.module.less"; +window?.Tracert?.call?.("set", { + spmAPos: SPAPOS, + spmBPos: location.pathname, + pathName: "首页" +}); +window?.Tracert?.call?.("logPv"); + const HomePage: React.FC = () => { const [needFixed, setNeedFixed] = useState(false); const [templateType, setTemplateType] = useState("REPO_CONTRIBUTE"); diff --git a/osgraph-web/src/main.tsx b/osgraph-web/src/main.tsx index a11dc9a..c1e0b25 100644 --- a/osgraph-web/src/main.tsx +++ b/osgraph-web/src/main.tsx @@ -4,6 +4,11 @@ import { RouterProvider } from "react-router-dom"; import "./i18n"; import router from "./router"; +window?.Tracert?.call("set", { + spmAPos: "a4378", + bizType: "common" +}); + ReactDOM.createRoot(document.getElementById("root")!).render( diff --git a/osgraph-web/src/result/index.tsx b/osgraph-web/src/result/index.tsx index b7aaffe..bb31cff 100644 --- a/osgraph-web/src/result/index.tsx +++ b/osgraph-web/src/result/index.tsx @@ -26,6 +26,7 @@ import { } from "../constants/index"; import { GRAPH_RENDER_MODEL } from "../constants/graph"; import { getUrlParams } from "../utils"; +import { SPAPOS } from "../constants/log"; import { timestampToDate } from '../utils/date'; import LayoutSelect from "../components/layout-select"; import ExtendParams from "../components/extend-params"; @@ -37,6 +38,13 @@ export default () => { const isMobile = getIsMobile(); const navigate = useNavigate(); + window?.Tracert?.call?.("set", { + spmAPos: SPAPOS, + spmBPos: location.pathname, + pathName: "结果页" + }); + window?.Tracert?.call?.("logPv"); + const powerByRef = useRef(null); const historyRef = useRef<{ redo?: () => void;