Skip to content

Commit

Permalink
chore: repo overall update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangtao25 committed Nov 20, 2024
1 parent d1440e7 commit 9ce958f
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,34 @@ import axios from "axios";
import MainBox from "@/components/main-box";

// http://localhost:3000/projects/123/commits/xxx/main/nihao/nihao/main.js
// http://localhost:3000/projects/59069994/commits/47bc7263d0ebf506bcfbaa2c053495bfc5d2c74a/src/main.ts

const fetcher = (url) =>
const fetcher = ({ url, params }) =>
axios
.get(url, {
params: {},
params: params,
})
.then((res) => res.data);

export default function Page() {
const { p, filepath, id, sha } = useParams(); // 获取动态路由参数
// console.log(p, filepath, id, sha, Report);
console.log(p, filepath, id, sha);
// p 是一个数组,包含路径的各个部分
const filePath = p ? p.join("/") : "文件路径未找到";
const filePath = filepath ? filepath.join("/") : "文件路径未找到";

const spar = {};

const { data } = useSWR("/api/cov/map", fetcher);
const { data } = useSWR(
{
url: "/api/cov/map",
params: {
project_id: id,
sha,
filepath: filePath,
},
},
fetcher,
);

return (
<MainBox>
Expand Down

0 comments on commit 9ce958f

Please sign in to comment.