- 회사 설정 hidden_fields 신설: 상품 목록·등록폼·엑셀 양식에서 감추고 목표가 후보에서도 제외 - 용어 카탈로그 9→37개(상품·협력사·견적 그룹), 목록·폼·엑셀 헤더 배선 - 엑셀 '최저한도' → '인터넷 최저가' 표기 정정(구양식 헤더는 alias 유지), 공급사 컬럼 검증 유지 - 목표가 산정내역에 적용 모드·숨김 필드 반영, 목표가 상한 라벨에 산식(상품단가×2) 표기 - 공급사 포털: 초청 링크 session_id 로 로그인 전 회사 브랜딩 조회(무인증 엔드포인트), 기본 브랜드 negotium 워드마크, negotium·AI O2O 크레딧 표기 - 목록 테이블 뷰포트 기준 전환·툴바 줄바꿈·협상현황 카드뷰로 모바일/태블릿 대응 - 이용안내 FAQ 탭 추가, 이용안내·회사설정 탭 URL 쿼리 동기화 및 빠른이동 등록
60 lines
2.2 KiB
TypeScript
60 lines
2.2 KiB
TypeScript
// 인증 엔드포인트 호출 함수 (순수 HTTP 레이어, React 의존 없음).
|
|
// refresh_token 재발급은 http.ts 인터셉터가 자동 처리하므로 여기서 노출하지 않는다.
|
|
import { http } from '@/apis/http'
|
|
import type {
|
|
CreateAccountRequest,
|
|
CreateAccountResponse,
|
|
HidePopupRequest,
|
|
HidePopupResponse,
|
|
LoginRequest,
|
|
LoginResponse,
|
|
LogoutResponse,
|
|
MeResponse,
|
|
PopupStatusResponse,
|
|
SessionBrandingResponse,
|
|
} from './auth.type'
|
|
|
|
export const authApi = {
|
|
/** POST /v1/auth/login — ID/PW 로 로그인, access/refresh 토큰 발급 */
|
|
login: async (body: LoginRequest): Promise<LoginResponse> => {
|
|
const res = await http.post<LoginResponse>('/v1/auth/login', body)
|
|
return res.data
|
|
},
|
|
|
|
/** POST /v1/auth/create — 신규 공급사 유저 계정 생성 */
|
|
createAccount: async (body: CreateAccountRequest): Promise<CreateAccountResponse> => {
|
|
const res = await http.post<CreateAccountResponse>('/v1/auth/create', body)
|
|
return res.data
|
|
},
|
|
|
|
/** GET /v1/auth/session-branding/{sessionId} — 로그인 전 화면용 브랜딩(인증 불필요) */
|
|
sessionBranding: async (sessionId: string): Promise<SessionBrandingResponse> => {
|
|
const res = await http.get<SessionBrandingResponse>(`/v1/auth/session-branding/${sessionId}`)
|
|
return res.data
|
|
},
|
|
|
|
/** GET /v1/auth/me — 현재 로그인 유저 정보 (access token 필요) */
|
|
me: async (): Promise<MeResponse> => {
|
|
const res = await http.get<MeResponse>('/v1/auth/me')
|
|
return res.data
|
|
},
|
|
|
|
/** POST /v1/auth/logout — 서버측 토큰 폐기(단일 세션) */
|
|
logout: async (): Promise<LogoutResponse> => {
|
|
const res = await http.post<LogoutResponse>('/v1/auth/logout')
|
|
return res.data
|
|
},
|
|
|
|
/** GET /v1/auth/popup/status — 유저별 팝업 '안내 보지 않기' 저장 상태 */
|
|
popupStatus: async (): Promise<PopupStatusResponse> => {
|
|
const res = await http.get<PopupStatusResponse>('/v1/auth/popup/status')
|
|
return res.data
|
|
},
|
|
|
|
/** POST /v1/auth/popup/hide — 해당 팝업을 다시 표시하지 않도록 영구 저장 */
|
|
hidePopup: async (body: HidePopupRequest): Promise<HidePopupResponse> => {
|
|
const res = await http.post<HidePopupResponse>('/v1/auth/popup/hide', body)
|
|
return res.data
|
|
},
|
|
}
|