Skip to content

Commit

Permalink
update url
Browse files Browse the repository at this point in the history
  • Loading branch information
su37josephxia committed Jun 10, 2023
1 parent 98c2934 commit 5ca945a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/[id].tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Canvas from "src/components/Canvas";
import ClientOnly from "src/components/ClientOnly";

export default function ID({data}: any) {
export default function ID({ data }: any) {
return (
<ClientOnly>
{data ? (
Expand All @@ -26,9 +26,9 @@ export const getStaticPaths = async () => {
// It won't be called on client-side, so you can even do
// direct database queries. See the "Technical details" section.
// 此函数在服务端的构建阶段调用,不会在客户端调用,因此这里相当于是直接查询数据库 SSG
export async function getStaticProps({params}: {params: {id: string}}) {
export async function getStaticProps({ params }: { params: { id: string } }) {
const res = await fetch(
"http://builder.codebus.tech/api/web/content/get?id=" + (params.id || 2)
"http://template.codebus.tech/api/web/content/get?id=" + (params.id || 2)
);
const data = await res.json();

Expand Down

0 comments on commit 5ca945a

Please sign in to comment.