This commit is contained in:
2025-07-01 10:51:57 +09:00
90 changed files with 4706 additions and 2209 deletions
@@ -4,7 +4,6 @@ import {
CLAIM_NAME,
REFRESH_TOKEN,
SERVER_API_URL,
SITE_ID,
} from "@/shared/config";
import { cookies } from "next/headers";
import { NextResponse } from "next/server";
@@ -15,9 +14,10 @@ async function handler(
method: "GET" | "POST" | "PUT" | "DELETE",
) {
const cookieStore = await cookies();
const siteId = cookieStore.get("site-id-key")?.value ?? "";
const headers: Record<string, string> = {
"Content-Type": "application/json",
"X-Site-Id": SITE_ID,
"X-Site-Id": siteId,
};
let body = {};
const isRefreshHandler = params.url.includes("refresh");
+12 -1
View File
@@ -1,5 +1,16 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {};
const nextConfig: NextConfig = {
async rewrites() {
return {
afterFiles: [
{
source: "/cms/:path*",
destination: "/:path*",
},
],
};
},
};
export default nextConfig;
-1
View File
@@ -39,7 +39,6 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@faker-js/faker": "^9.5.0",
"@types/js-cookie": "^3.0.6",
"@types/node": "^22.13.1",
"@types/webpack": "^5.28.5",
@@ -4,10 +4,11 @@ import { useEffect } from "react";
import { usePathname, useRouter } from "next/navigation";
import { MenuAuthorityApi } from "@/entities/menu-authority/@x/menu";
import { getCookie, useAlertStore, useMenuStore } from "@/shared/lib";
import { SITE_ID } from "@/shared/config";
import { MenuApi } from "../api/menu-service";
import { getCurrentMenu } from "./utils";
const siteId = getCookie("site-id-key") ?? "";
const MenuWrapper = ({ children }: { children: React.ReactNode }) => {
const router = useRouter();
const pathname = usePathname();
@@ -17,7 +18,7 @@ const MenuWrapper = ({ children }: { children: React.ReactNode }) => {
useMenuStore((state) => state);
const getCurrentMenuInfo = async () => {
const menuRoles = await MenuApi.getMenuRoles(SITE_ID);
const menuRoles = await MenuApi.getMenuRoles(siteId);
if (!menuRoles) return;
return getCurrentMenu(menuRoles, pathname ?? "");
};
@@ -1,8 +1,10 @@
import { Client } from "@common/network";
import { BASE_URL } from "../config/api";
import { SITE_ID } from "../config/env";
import { getCookie } from "../lib";
const siteId = getCookie("site-id-key") ?? "";
export const client = Client.getInstance({
baseURL: BASE_URL,
siteId: SITE_ID,
siteId,
});
@@ -2,7 +2,6 @@ export const PORT = process.env.NEXT_PUBLIC_PORT || "13000";
export const PROXY_HOST =
process.env.NEXT_PUBLIC_PROXY_HOST || `http://localhost:${PORT}`;
export const SERVER_API_URL = process.env.NEXT_PUBLIC_SERVER_API_URL;
export const SITE_ID = process.env.NEXT_PUBLIC_SITE_ID || "CS";
export const CLAIM_NAME = process.env.NEXT_PUBLIC_CLAIM_NAME || "Authorization";
export const ACCESS_TOKEN =
process.env.NEXT_PUBLIC_ACCESS_TOKEN || "access-token";
@@ -77,7 +77,7 @@ function PostPage({ bbsId }: { bbsId: string }) {
isLoading,
refetch,
} = useQuery({
queryKey: [ENDPOINT.BOARD_SERVICE.POSTS_USER, bbsId],
queryKey: [ENDPOINT.BOARD_SERVICE.POSTS_USER, bbsId, pagination],
queryFn: () =>
PostApi.getPostList(parseInt(bbsId), {
...postParams,