Compare commits

...

7 Commits

Author SHA1 Message Date
31a63cb643 Merge branch 'dev' of https://git.hanasys.jp/qcast3/onsitesurvey into feature/inquiry 2025-05-22 18:13:26 +09:00
50a2335590 feat: get inquiry type common code 2025-05-22 18:13:16 +09:00
a5696984fc refactor: Update middleware and EdgeProvider for session handling
- Modified middleware matcher to exclude additional routes for improved session management.
- Added login redirection logic in EdgeProvider to ensure users are redirected to the login page if not authenticated.
2025-05-22 17:08:54 +09:00
c76526bf9b chore: Update package.json scripts and enhance middleware session handling
- Added local build and start scripts to package.json for improved local development.
- Commented out login redirection logic in middleware for future implementation.
- Introduced a new checkbox in the sample page for enhanced UI functionality.
- Refactored useAxios to improve request and response handling with better modularization.
- Updated checkbox styles in SCSS for improved visual consistency.
2025-05-22 16:57:54 +09:00
e8498948df refactor: Update tracking function to utilize useAxios for API calls
- Replaced direct axiosInstance import with useAxios hook for improved API management.
- Enhanced code structure for better readability and maintainability.
2025-05-22 15:07:41 +09:00
0a88c80bd9 refactor: Update Header component to utilize useAxios for API integration
- Replaced direct axiosInstance import with useAxios hook for improved API management.
- Cleaned up imports and enhanced code structure for better readability.
2025-05-22 15:04:59 +09:00
e846b55faa chore: Update environment configuration and enhance API integration
- Added NEXT_PUBLIC_RUN_MODE to .env files for environment differentiation.
- Introduced .env.localhost for local development settings.
- Updated .env.production with the correct API URL.
- Modified package.json scripts to utilize env-cmd for environment-specific commands.
- Created a common configuration module to manage environment-specific settings.
- Refactored useAxios to utilize the new configuration for base URL management.
- Enhanced Footer component to display current configuration values.
2025-05-22 15:00:41 +09:00
24 changed files with 325 additions and 46 deletions

View File

@ -1,3 +1,4 @@
NEXT_PUBLIC_RUN_MODE=development
# 모바일 디바이스로 로컬 서버 확인하려면 자신 IP 주소로 변경
# 다시 로컬에서 개발할때는 localhost로 변경
#route handler

18
.env.localhost Normal file
View File

@ -0,0 +1,18 @@
NEXT_PUBLIC_RUN_MODE=local
# 모바일 디바이스로 로컬 서버 확인하려면 자신 IP 주소로 변경
# 다시 로컬에서 개발할때는 localhost로 변경
#route handler
NEXT_PUBLIC_API_URL=http://localhost:3000
#qsp 로그인 api
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
#1:1문의 api
NEXT_PUBLIC_INQUIRY_API_URL=http://1.248.227.176:38080
#QPARTNER 로그인 api
DB_HOST=202.218.61.226
DB_USER=readonly
DB_PASSWORD=aAjmFW12iHKW84l1
DB_DATABASE=qpartners
DB_PORT=3306

View File

@ -1,5 +1,6 @@
NEXT_PUBLIC_RUN_MODE=production
#route handler
NEXT_PUBLIC_API_URL=http://172.30.1.35:3000
NEXT_PUBLIC_API_URL=http://1.248.227.176:3000
#qsp 로그인 api
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120

View File

@ -3,9 +3,15 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"dev": "env-cmd -f .env.localhost next dev --turbopack",
"build": "next build",
"start": "next start",
"build:local": "env-cmd -f .env.localhost next build",
"build:dev": "env-cmd -f .env.development next build",
"build:prod": "env-cmd -f .env.production next build",
"start:local": "env-cmd -f .env.localhost next start",
"start:dev": "env-cmd -f .env.development next start",
"start:prod": "env-cmd -f .env.production next start",
"lint": "next lint"
},
"dependencies": {
@ -13,6 +19,7 @@
"@tanstack/react-query": "^5.71.0",
"@tanstack/react-query-devtools": "^5.71.0",
"axios": "^1.8.4",
"env-cmd": "^10.1.0",
"iron-session": "^8.0.4",
"lucide": "^0.503.0",
"mssql": "^11.0.1",

63
pnpm-lock.yaml generated
View File

@ -20,6 +20,9 @@ importers:
axios:
specifier: ^1.8.4
version: 1.8.4
env-cmd:
specifier: ^10.1.0
version: 10.1.0
iron-session:
specifier: ^8.0.4
version: 8.0.4
@ -801,6 +804,10 @@ packages:
resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==}
engines: {node: '>=16'}
commander@4.1.1:
resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}
engines: {node: '>= 6'}
cookie@0.7.2:
resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==}
engines: {node: '>= 0.6'}
@ -808,6 +815,10 @@ packages:
core-js@3.41.0:
resolution: {integrity: sha512-SJ4/EHwS36QMJd6h/Rg+GyR4A5xE0FSI3eZ+iBVpfqf1x0eTSg1smWLHrA+2jQThZSh97fmSgFSU8B61nxosxA==}
cross-spawn@7.0.6:
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
engines: {node: '>= 8'}
css-line-break@2.1.0:
resolution: {integrity: sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==}
@ -866,6 +877,11 @@ packages:
resolution: {integrity: sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==}
engines: {node: '>=10.13.0'}
env-cmd@10.1.0:
resolution: {integrity: sha512-mMdWTT9XKN7yNth/6N6g2GuKuJTsKMDHlQFUDacb/heQRRWOTIZ42t1rMHnQu4jYxU1ajdTeJM+9eEETlqToMA==}
engines: {node: '>=8.0.0'}
hasBin: true
es-define-property@1.0.1:
resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==}
engines: {node: '>= 0.4'}
@ -1021,6 +1037,9 @@ packages:
resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==}
engines: {node: '>=16'}
isexe@2.0.0:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
jiti@2.4.2:
resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==}
hasBin: true
@ -1217,6 +1236,10 @@ packages:
resolution: {integrity: sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==}
engines: {node: '>=18'}
path-key@3.1.1:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'}
performance-now@2.1.0:
resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==}
@ -1324,6 +1347,14 @@ packages:
resolution: {integrity: sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
shebang-command@2.0.0:
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
engines: {node: '>=8'}
shebang-regex@3.0.0:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
simple-swizzle@0.2.2:
resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==}
@ -1423,6 +1454,11 @@ packages:
resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==}
hasBin: true
which@2.0.2:
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
engines: {node: '>= 8'}
hasBin: true
zustand@5.0.3:
resolution: {integrity: sha512-14fwWQtU3pH4dE0dOpdMiWjddcH+QzKIgk1cl8epwSE7yag43k/AD/m4L6+K7DytAOr9gGBe3/EXj9g7cdostg==}
engines: {node: '>=12.20.0'}
@ -2070,11 +2106,19 @@ snapshots:
commander@11.1.0: {}
commander@4.1.1: {}
cookie@0.7.2: {}
core-js@3.41.0:
optional: true
cross-spawn@7.0.6:
dependencies:
path-key: 3.1.1
shebang-command: 2.0.0
which: 2.0.2
css-line-break@2.1.0:
dependencies:
utrie: 1.0.2
@ -2123,6 +2167,11 @@ snapshots:
graceful-fs: 4.2.11
tapable: 2.2.1
env-cmd@10.1.0:
dependencies:
commander: 4.1.1
cross-spawn: 7.0.6
es-define-property@1.0.1: {}
es-errors@1.3.0: {}
@ -2297,6 +2346,8 @@ snapshots:
dependencies:
is-inside-container: 1.0.0
isexe@2.0.0: {}
jiti@2.4.2: {}
js-md4@0.3.2: {}
@ -2500,6 +2551,8 @@ snapshots:
is-inside-container: 1.0.0
is-wsl: 3.1.0
path-key@3.1.1: {}
performance-now@2.1.0:
optional: true
@ -2622,6 +2675,12 @@ snapshots:
'@img/sharp-win32-x64': 0.33.5
optional: true
shebang-command@2.0.0:
dependencies:
shebang-regex: 3.0.0
shebang-regex@3.0.0: {}
simple-swizzle@0.2.2:
dependencies:
is-arrayish: 0.3.2
@ -2703,6 +2762,10 @@ snapshots:
uuid@8.3.2: {}
which@2.0.2:
dependencies:
isexe: 2.0.0
zustand@5.0.3(@types/react@19.0.12)(react@19.1.0):
optionalDependencies:
'@types/react': 19.0.12

19
src/app/api/qna/route.ts Normal file
View File

@ -0,0 +1,19 @@
import { NextResponse } from 'next/server'
import axios from 'axios'
import { CommonCode } from '@/types/Inquiry'
export async function GET() {
const response = await axios.get(`${process.env.NEXT_PUBLIC_INQUIRY_API_URL}/api/system/commonCodeListData`)
const codeList: CommonCode[] = []
response.data.data.apiCommCdList.forEach((item: any) => {
if (item.headCd === '204200' || item.headCd === '204300' || item.headCd === '204400') {
codeList.push({
headCd: item.headCd,
code: item.code,
name: item.codeJp,
refChar1: item.refChr1,
})
}
})
return NextResponse.json({ data: codeList })
}

View File

@ -113,6 +113,10 @@ export default function page() {
<input type="checkbox" id="ch06" disabled />
<label htmlFor="ch06">Check Box</label>
</div>
<div className="check-form-box space">
<input type="checkbox" id="ch07" defaultChecked />
<label htmlFor="ch07">Check Box</label>
</div>
</div>
</div>
<div className="design-box">

View File

@ -5,9 +5,8 @@ import { useEffect, useReducer, useState } from 'react'
import { useRouter } from 'next/navigation'
import { useLocalStorage } from 'usehooks-ts'
import { useQuery } from '@tanstack/react-query'
import { axiosInstance } from '@/libs/axios'
import { useSessionStore } from '@/store/session'
import { useAxios } from '@/hooks/useAxios'
interface AccountState {
loginId: string
pwd: string
@ -24,6 +23,8 @@ export default function Login() {
//로그인 상태
const [isLogin, setIsLogin] = useState(false)
const { axiosInstance } = useAxios()
const { session, setSession } = useSessionStore()
const [value, setValue, removeValue] = useLocalStorage<{ indivisualData: string }>('hanasysIndivisualState', { indivisualData: '' })

View File

@ -40,6 +40,8 @@ export default function RegistForm() {
}
}, [session])
const { commonCodeList } = useInquiry()
const [attachedFiles, setAttachedFiles] = useState<File[]>([])
const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
@ -113,9 +115,14 @@ export default function RegistForm() {
value={inquiryRequest.qnaClsLrgCd}
onChange={(e) => setInquiryRequest({ ...inquiryRequest, qnaClsLrgCd: e.target.value })}
>
<option value=""></option>
<option value="A01">A01</option>
<option value="204200">204200</option>
<option value="" hidden></option>
{commonCodeList
.filter((code) => code.headCd === '204200')
.map((code) => (
<option key={code.code} value={code.code}>
{code.name}
</option>
))}
</select>
</div>
<div className="data-input mt5">
@ -126,9 +133,14 @@ export default function RegistForm() {
value={inquiryRequest.qnaClsMidCd}
onChange={(e) => setInquiryRequest({ ...inquiryRequest, qnaClsMidCd: e.target.value })}
>
<option value=""></option>
<option value="B02">B02</option>
<option value="204300">204300</option>
<option value="" hidden></option>
{commonCodeList
.filter((code) => code.refChar1 === inquiryRequest.qnaClsLrgCd)
.map((code) => (
<option key={code.code} value={code.code}>
{code.name}
</option>
))}
</select>
</div>
<div className="data-input mt5">
@ -139,9 +151,14 @@ export default function RegistForm() {
value={inquiryRequest.qnaClsSmlCd ?? ''}
onChange={(e) => setInquiryRequest({ ...inquiryRequest, qnaClsSmlCd: e.target.value })}
>
<option value=""></option>
<option value="C05">C05</option>
<option value="204400">204400</option>
<option value="" hidden></option>
{commonCodeList
.filter((code) => code.refChar1 === inquiryRequest.qnaClsMidCd)
.map((code) => (
<option key={code.code} value={code.code}>
{code.name}
</option>
))}
</select>
</div>
</div>

View File

@ -46,9 +46,7 @@ export default function ListTable() {
if (!session.isLoggedIn || !inquiryList) return
if (session.isLoggedIn) {
setInquiryListRequest({ ...inquiryListRequest, storeId: session.storeId ?? '', loginId: session.userId ?? '' })
// setInquiryListRequest({ ...inquiryListRequest, storeId: 'X112', loginId: 'x112' })
}
console.log('inquiryListRequest', inquiryListRequest)
if (inquiryList.length > 0 && inquiryList[0].totCnt > 0) {
if (inquiryListRequest.startRow > 1) {
const isDuplicate = inquiryList.every((newItem) => heldInquiryList.some((existingItem) => existingItem.qnaNo === newItem.qnaNo))

View File

@ -1,6 +1,7 @@
'use client'
import Link from 'next/link'
import Config from '@/config/config.export'
export default function Footer() {
return (
@ -11,6 +12,9 @@ export default function Footer() {
<span>
<Link href="/pdf">PDF</Link>
</span>
<span>{Config().mode}</span>
<span>{Config().baseUrl}</span>
<span>{process.env.NEXT_PUBLIC_API_URL}</span>
</div>
</footer>
</>

View File

@ -13,14 +13,13 @@ import { useSessionStore } from '@/store/session'
import { usePopupController } from '@/store/popupController'
import { useTitle } from '@/hooks/useTitle'
import { axiosInstance } from '@/libs/axios'
import { useAxios } from '@/hooks/useAxios'
import 'swiper/css'
export default function Header() {
const router = useRouter()
const pathname = usePathname()
const { axiosInstance } = useAxios()
const [value, setValue, removeValue] = useLocalStorage<{ indivisualData: string }>('hanasysIndivisualState', { indivisualData: '' })
const { sideNavIsOpen, setSideNavIsOpen } = useSideNavState()
const { backBtn } = useHeaderStore()

View File

@ -0,0 +1,20 @@
export declare namespace ICommonConfig {
export type Mode = 'local' | 'development' | 'production'
export interface Params {
baseUrl: string
mode: Mode
}
}
// local, development, production 과 관계없이 동일한 값으로 반환되는 부분은 해당 함수의 return 되는 부분만 수정하면 됩니다. (달라져야 하는 값이 아닌, 같은 값에 대해서는 local, development, production 파일을 모두 수정할 필요가 없어지게 됩니다.)
export default function getConfigs(params: ICommonConfig.Params) {
// local, development, production 마다 달라지는 값
const { baseUrl, mode } = params
// 공통으로 반환되는 구조
return {
baseUrl,
mode,
}
}

View File

@ -0,0 +1,13 @@
import getConfigs from '@/config/config.common'
// 환경마다 달라져야 할 변수, 값들을 정의합니다. (여기는 development 환경에 맞는 값을 지정합니다.)
const baseUrl = 'http://1.248.227.176:3000'
const mode = 'development'
// 환경마다 달라져야 할 값들을 getConfig 함수에 전달합니다.
const configDevelopment = getConfigs({
baseUrl,
mode,
})
export default configDevelopment

View File

@ -0,0 +1,19 @@
import configDevelopment from './config.development'
import configLocal from './config.local'
import configProduction from './config.production'
// 클라이언트에서는 이 함수를 사용하여 config 값을 참조합니다.
const Config = () => {
switch (process.env.NEXT_PUBLIC_RUN_MODE) {
case 'local':
return configLocal
case 'development':
return configDevelopment
case 'production':
return configProduction
default:
return configLocal
}
}
export default Config

View File

@ -0,0 +1,13 @@
import getConfigs from '@/config/config.common'
// 환경마다 달라져야 할 변수, 값들을 정의합니다. (여기는 local 환경에 맞는 값을 지정합니다.)
const baseUrl = 'http://localhost:3000'
const mode = 'local'
// 환경마다 달라져야 할 값들을 getConfig 함수에 전달합니다.
const configLocal = getConfigs({
baseUrl,
mode,
})
export default configLocal

View File

@ -0,0 +1,13 @@
import getConfigs from '@/config/config.common'
// 환경마다 달라져야 할 변수, 값들을 정의합니다. (여기는 production 환경에 맞는 값을 지정합니다.)
const baseUrl = 'http://localhost.prod:3000'
const mode = 'production'
// 환경마다 달라져야 할 값들을 getConfig 함수에 전달합니다.
const configProduction = getConfigs({
baseUrl,
mode,
})
export default configProduction

View File

@ -1,39 +1,65 @@
import axios from 'axios'
import axios, { AxiosResponse, InternalAxiosRequestConfig } from 'axios'
import Config from '@/config/config.export'
import { useSpinnerStore } from '@/store/spinnerStore'
export const useAxios = () => {
const { setIsShow } = useSpinnerStore()
export function useAxios() {
// const { setIsShow } = useSpinnerStore()
const requestHandler = (config: InternalAxiosRequestConfig) => {
// setIsShow(true)
return config
}
const responseHandler = (response: AxiosResponse) => {
// setIsShow(false)
response.data = transferResponse(response)
return response
}
const errorHandler = (error: any) => {
// setIsShow(false)
return Promise.reject(error)
}
const createAxiosInstance = (url: string | null | undefined) => {
const baseURL = url || Config().baseUrl
return axios.create({
baseURL,
headers: {
Accept: 'application/json',
},
})
}
const axiosInstance = (url: string | null | undefined) => {
const baseURL = url || process.env.NEXT_PUBLIC_API_URL
const instance = axios.create({
baseURL,
baseURL: url || Config().baseUrl,
headers: {
Accept: 'application/json',
},
})
instance.interceptors.request.use(
(config) => {
// console.log('🚀 ~ config:', config)
setIsShow(true)
return config
},
(error) => {
return Promise.reject(error)
},
// (config) => {
// return config
// },
// (error) => {
// return Promise.reject(error)
// },
(config) => requestHandler(config),
(error) => errorHandler(error),
)
instance.interceptors.response.use(
(response) => {
response.data = transferResponse(response)
setIsShow(false)
return response
},
(error) => {
// 에러 처리 로직
return Promise.reject(error)
},
// (response) => {
// response.data = transferResponse(response)
// return response
// },
// (error) => {
// return Promise.reject(error)
// },
(response) => responseHandler(response),
(error) => errorHandler(error),
)
return instance

View File

@ -1,4 +1,4 @@
import { InquiryList, Inquiry, InquirySaveResponse } from '@/types/Inquiry'
import { InquiryList, Inquiry, InquirySaveResponse, CommonCode } from '@/types/Inquiry'
import { useAxios } from '@/hooks/useAxios'
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { useInquiryFilterStore } from '@/store/inquiryFilterStore'
@ -16,6 +16,7 @@ export function useInquiry(
isSavingInquiry: boolean
saveInquiry: (formData: FormData) => Promise<InquirySaveResponse>
downloadFile: (encodeFileNo: number) => Promise<File>
commonCodeList: CommonCode[]
} {
const queryClient = useQueryClient()
const { inquiryListRequest } = useInquiryFilterStore()
@ -78,6 +79,16 @@ export function useInquiry(
return resp.data
}
const { data: commonCodeList, isLoading: isLoadingCommonCodeList } = useQuery({
queryKey: ['commonCodeList'],
queryFn: async () => {
const resp = await axiosInstance(null).get<{ data: CommonCode[] }>(`/api/qna`)
return resp.data
},
staleTime: Infinity,
gcTime: Infinity,
})
return {
inquiryList: inquriyListData.inquiryList,
inquiryDetail: inquiryDetail ?? null,
@ -86,5 +97,6 @@ export function useInquiry(
isSavingInquiry,
saveInquiry,
downloadFile,
commonCodeList: commonCodeList?.data ?? [],
}
}

View File

@ -1,7 +1,8 @@
import { axiosInstance } from './axios'
import { useAxios } from '@/hooks/useAxios'
export const tracking = async (params: { url: string; data: string }) => {
const { url, data } = params
const { axiosInstance } = useAxios()
const result = await axiosInstance(null).post('/api/tracking', {
url,
data,

View File

@ -10,9 +10,9 @@ export async function middleware(request: NextRequest) {
const session = await getIronSession<SessionData>(cookieStore, sessionOptions)
// todo: 로그인 기능 추가 시 주석 해제
if (!session.isLoggedIn) {
return NextResponse.redirect(new URL('/login', request.url))
}
// if (!session.isLoggedIn) {
// return NextResponse.redirect(new URL('/login', request.url))
// }
return NextResponse.next()
}
@ -22,5 +22,5 @@ export async function middleware(request: NextRequest) {
// 2. /admin/* (exclude all routes under /admin)
// 3. /_next/* (exclude Next.js static and image assets)
export const config = {
matcher: ['/((?!dashboard|login|admin|api|_next/static|_next/image|favicon.ico).*)'],
matcher: ['/((?!login|assets).*)', '/((?!_next/static|_next/image|favicon.ico).*)'],
}

View File

@ -74,6 +74,12 @@ export default function EdgeProvider({ children, sessionData }: EdgeProviderProp
router.push('/')
}
}
if (pathname === '/') {
if (!session?.isLoggedIn) {
router.push('/login')
}
}
//alert 함수 변경해서 바인딩
window.alert = function (msg, alertBtn = () => setAlert(false)) {
alertFunc(msg, alertBtn)

View File

@ -98,6 +98,23 @@
color: #8595A7;
}
}
&.space{
label{
&::after{
top: 8px;
left: 0px;
width: 10px;
height: 2px;
border: none;
background-color: transparent;
transform: translate(50%, 50%);
-ms-transform: none;
}
}
input[type="checkbox"]:checked + label::after{
background-color: #fff;
}
}
}
// radio box

View File

@ -89,3 +89,10 @@ export type InquirySaveResponse = {
qnaNo: number //qna number
mailYn: string //mail yn - Y / N
}
export type CommonCode = {
headCd: string
code: string
name: string
refChar1: string
}