diff --git a/.env.development b/.env.development index 054ba65..5822f05 100644 --- a/.env.development +++ b/.env.development @@ -18,6 +18,8 @@ NEXT_PUBLIC_QSP_API_URL=http://121.168.9.37:8080 # NEXT_PUBLIC_QSP_API_URL=http://localhost:8110 # NEXT_PUBLIC_QSP_API_URL=http://dev.hanasysfield.jp # NEXT_PUBLIC_QSP_API_URL=https://jp-dev.qsalesplatform.com +#qsp 로그인 api header +NEXT_PUBLIC_QSP_API_REFERER=hanasysfield.jp #1:1문의 api NEXT_PUBLIC_INQUIRY_API_URL=https://jp-dev.qsalesplatform.com diff --git a/.env.localhost b/.env.localhost index 128d723..c4f0028 100644 --- a/.env.localhost +++ b/.env.localhost @@ -15,6 +15,8 @@ NEXT_PUBLIC_API_URL=http://localhost:3000 #qsp 로그인 api NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120 # NEXT_PUBLIC_QSP_API_URL=https://jp-dev.qsalesplatform.com +#qsp 로그인 api header +NEXT_PUBLIC_QSP_API_REFERER=hanasysfield.jp #1:1문의 api # NEXT_PUBLIC_INQUIRY_API_URL=https://jp-dev.qsalesplatform.com diff --git a/.env.production b/.env.production index a3e97ad..b2d22d9 100644 --- a/.env.production +++ b/.env.production @@ -14,6 +14,8 @@ NEXT_PUBLIC_API_URL=https://hanasysfield.jp #qsp 로그인 api # NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120 NEXT_PUBLIC_QSP_API_URL=https://jp.qsalesplatform.com +#qsp 로그인 api header +NEXT_PUBLIC_QSP_API_REFERER=hanasysfield.jp #1:1문의 api NEXT_PUBLIC_INQUIRY_API_URL=https://jp.qsalesplatform.com diff --git a/src/app/api/auth/route.ts b/src/app/api/auth/route.ts index c474593..57bb071 100644 --- a/src/app/api/auth/route.ts +++ b/src/app/api/auth/route.ts @@ -9,10 +9,18 @@ import { tracking } from '@/libs/tracking' export async function POST(request: Request) { const { loginId, pwd } = await request.json() - const result = await axiosInstance(`${process.env.NEXT_PUBLIC_QSP_API_URL}`).post(`/api/user/login`, { - loginId, - pwd, - }) + const result = await axiosInstance(`${process.env.NEXT_PUBLIC_QSP_API_URL}`).post( + `/api/user/login`, + { + loginId, + pwd, + }, + { + headers: { + referer: process.env.NEXT_PUBLIC_QSP_API_REFERER, + }, + }, + ) console.log('🚀 ~ result ~ result:', result.data) let finalResult = {}