[feat] negodata·공급사포털: 상품 필드 숨김 설정·용어 카탈로그 확장·로그인 전 브랜딩·모바일 대응
- 회사 설정 hidden_fields 신설: 상품 목록·등록폼·엑셀 양식에서 감추고 목표가 후보에서도 제외 - 용어 카탈로그 9→37개(상품·협력사·견적 그룹), 목록·폼·엑셀 헤더 배선 - 엑셀 '최저한도' → '인터넷 최저가' 표기 정정(구양식 헤더는 alias 유지), 공급사 컬럼 검증 유지 - 목표가 산정내역에 적용 모드·숨김 필드 반영, 목표가 상한 라벨에 산식(상품단가×2) 표기 - 공급사 포털: 초청 링크 session_id 로 로그인 전 회사 브랜딩 조회(무인증 엔드포인트), 기본 브랜드 negotium 워드마크, negotium·AI O2O 크레딧 표기 - 목록 테이블 뷰포트 기준 전환·툴바 줄바꿈·협상현황 카드뷰로 모바일/태블릿 대응 - 이용안내 FAQ 탭 추가, 이용안내·회사설정 탭 URL 쿼리 동기화 및 빠른이동 등록
This commit is contained in:
1 parent
4927c9184e
commit
0f10b6a70f
43 files changed
+896
-143
No files matched your search
@@ -11,6 +11,7 @@ import type {
|
||||
LogoutResponse,
|
||||
MeResponse,
|
||||
PopupStatusResponse,
|
||||
SessionBrandingResponse,
|
||||
} from './auth.type'
|
||||
|
||||
export const authApi = {
|
||||
@@ -26,6 +27,12 @@ export const authApi = {
|
||||
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')
|
||||
|
||||
@@ -61,6 +61,14 @@ export interface Branding {
|
||||
email_header?: string
|
||||
}
|
||||
|
||||
// 로그인 전(초청 링크 진입) 브랜딩 조회 — GET /v1/auth/session-branding/{session_id}, 인증 불필요
|
||||
export interface SessionBrandingResponse {
|
||||
result: ApiResult
|
||||
service_name: string
|
||||
logo_url: string
|
||||
primary_color: string
|
||||
}
|
||||
|
||||
// 협상완료 부가정보 필드 정의(companies.settings.session_fields)
|
||||
export interface SessionField {
|
||||
key: string
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
@@ -1,14 +1,14 @@
|
||||
import { type ComponentProps } from 'react'
|
||||
import { cn } from '@/lib'
|
||||
import logoColor from '@/assets/imarketkorea-logo.png'
|
||||
import logoWhite from '@/assets/imarketkorea-logo-white.png'
|
||||
import logoDefault from '@/assets/negotium-logo.png'
|
||||
|
||||
export type LogoVariant = 'color' | 'white'
|
||||
export type LogoSize = 'sm' | 'md' | 'lg'
|
||||
|
||||
// 기본 브랜드(회사 설정 미지정 시). 회사 로고가 오면 logoUrl 이 이 값을 덮는다.
|
||||
const sources: Record<LogoVariant, string> = {
|
||||
color: logoColor,
|
||||
white: logoWhite,
|
||||
color: logoDefault,
|
||||
white: logoDefault,
|
||||
}
|
||||
|
||||
const sizes: Record<LogoSize, { img: string; text: string; gap: string }> = {
|
||||
@@ -17,6 +17,13 @@ const sizes: Record<LogoSize, { img: string; text: string; gap: string }> = {
|
||||
lg: { img: 'h-10', text: 'text-2xl', gap: 'gap-2.5' },
|
||||
}
|
||||
|
||||
// 기본 브랜드 로고는 가로로 긴 워드마크라 같은 높이로 두면 회사 심볼보다 훨씬 커 보인다(랜딩도 h-4 기준).
|
||||
const wordmarkSizes: Record<LogoSize, string> = {
|
||||
sm: 'h-3.5',
|
||||
md: 'h-4',
|
||||
lg: 'h-5',
|
||||
}
|
||||
|
||||
export interface LogoProps extends Omit<ComponentProps<'div'>, 'children'> {
|
||||
variant?: LogoVariant
|
||||
size?: LogoSize
|
||||
@@ -31,23 +38,23 @@ export function Logo({
|
||||
variant = 'color',
|
||||
size = 'md',
|
||||
withText = true,
|
||||
alt = 'iMarket Korea',
|
||||
alt = 'NEGOTIUM',
|
||||
serviceName,
|
||||
logoUrl,
|
||||
className,
|
||||
...props
|
||||
}: LogoProps) {
|
||||
const s = sizes[size]
|
||||
const name = serviceName || 'iMarket Korea'
|
||||
const name = serviceName || 'negotium'
|
||||
|
||||
return (
|
||||
<div className={cn('flex items-center', s.gap, className)} {...props}>
|
||||
<img
|
||||
src={logoUrl || sources[variant]}
|
||||
alt={withText ? '' : (serviceName || alt)}
|
||||
className={cn('w-auto select-none', s.img)}
|
||||
className={cn('w-auto select-none', logoUrl ? s.img : wordmarkSizes[size])}
|
||||
/>
|
||||
{withText && (
|
||||
{withText && serviceName && (
|
||||
<span className={cn('font-bold tracking-[-0.4px] text-foreground', s.text)}>
|
||||
{name}
|
||||
</span>
|
||||
|
||||
@@ -6,7 +6,10 @@ import { tokenStorage } from '@/apis'
|
||||
// 토큰이 있으나 만료/폐기된 경우는 요청 시 인터셉터가 세션을 종료시킨다.
|
||||
export function RequireAuth({ children }: { children: ReactNode }) {
|
||||
if (!tokenStorage.hasToken()) {
|
||||
return <Navigate to="/" replace />
|
||||
// 초청 링크(/chat?session_id=...)로 들어온 미로그인 사용자 — session_id 를 넘겨야
|
||||
// 로그인 화면이 그 회사 브랜딩으로 뜬다.
|
||||
const sessionId = new URLSearchParams(window.location.search).get('session_id')
|
||||
return <Navigate to={sessionId ? `/?session_id=${sessionId}` : '/'} replace />
|
||||
}
|
||||
return <>{children}</>
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useSearchParams } from 'react-router'
|
||||
import { authApi } from '@/apis'
|
||||
import type { Branding } from '@/apis/auth/auth.type'
|
||||
|
||||
// 로그인 전 화면(로그인 페이지)의 회사 브랜딩.
|
||||
// 협력사는 초청 메일의 /chat?session_id=... 로 들어오므로, 그 session_id 로 인증 없이 브랜딩만 조회한다.
|
||||
// session_id 가 없으면 회사를 특정할 수 없으므로 기본 브랜드(Negosium)로 둔다.
|
||||
export function usePreLoginBranding(): Branding | null {
|
||||
const [searchParams] = useSearchParams()
|
||||
const [branding, setBranding] = useState<Branding | null>(null)
|
||||
|
||||
const sessionId = searchParams.get('session_id') ?? ''
|
||||
|
||||
useEffect(() => {
|
||||
if (!sessionId) return
|
||||
let alive = true
|
||||
void authApi
|
||||
.sessionBranding(sessionId)
|
||||
.then((res) => {
|
||||
if (!alive || res.result?.success === false) return
|
||||
const next: Branding = {
|
||||
service_name: res.service_name || undefined,
|
||||
logo_url: res.logo_url || undefined,
|
||||
primary_color: res.primary_color || undefined,
|
||||
}
|
||||
if (!next.service_name && !next.logo_url) return
|
||||
setBranding(next)
|
||||
})
|
||||
.catch(() => {
|
||||
// 조회 실패 시 기본 브랜드로 그대로 둔다
|
||||
})
|
||||
return () => {
|
||||
alive = false
|
||||
}
|
||||
}, [sessionId])
|
||||
|
||||
return branding
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export { LoginForm } from '@/features/auth/components/LoginForm'
|
||||
export { SidebarFooter } from '@/features/auth/components/SidebarFooter'
|
||||
export { RequireAuth } from '@/features/auth/components/RequireAuth'
|
||||
export { usePreLoginBranding } from '@/features/auth/hooks/usePreLoginBranding'
|
||||
@@ -53,6 +53,9 @@ export function MainLayout({
|
||||
{logoAction}
|
||||
</div>
|
||||
{sidebar}
|
||||
<p className="mt-auto px-4 py-3 text-[10px] font-medium text-neutral-50">
|
||||
© {new Date().getFullYear()} negotium · Made by AI O2O
|
||||
</p>
|
||||
</aside>
|
||||
|
||||
<main className={styles.main}>
|
||||
|
||||
@@ -8,6 +8,12 @@ export function ListPage() {
|
||||
<main className="mx-auto w-full max-w-7xl flex-1 px-4 py-6 sm:px-6">
|
||||
<ListWorkspace />
|
||||
</main>
|
||||
{/* 솔루션·제작사 표기 — 회사 브랜딩(헤더 로고)과 무관하게 고정 */}
|
||||
<footer className="border-t border-border px-4 py-4 text-center sm:px-6">
|
||||
<p className="text-[11px] font-medium text-neutral-50">
|
||||
© {new Date().getFullYear()} negotium · Made by AI O2O
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { Navigate } from 'react-router'
|
||||
import { tokenStorage } from '@/apis'
|
||||
import { Logo } from '@/components'
|
||||
import { LoginForm } from '@/features/auth'
|
||||
import { LoginForm, usePreLoginBranding } from '@/features/auth'
|
||||
|
||||
export function LoginPage() {
|
||||
// 초청 링크의 session_id(없으면 직전 로그인 캐시)로 회사 브랜딩을 먼저 그린다.
|
||||
const branding = usePreLoginBranding()
|
||||
|
||||
// 이미 로그인된 상태면 목록으로
|
||||
if (tokenStorage.hasToken()) {
|
||||
return <Navigate to="/list" replace />
|
||||
@@ -14,24 +17,29 @@ export function LoginPage() {
|
||||
<div className="flex w-full max-w-sm flex-col items-center gap-6">
|
||||
{/* 브랜드 락업 */}
|
||||
<div className="flex flex-col items-center gap-2">
|
||||
<Logo size="lg" />
|
||||
<Logo size="lg" serviceName={branding?.service_name} logoUrl={branding?.logo_url} />
|
||||
<p className="text-[13px] font-medium tracking-[-0.26px] text-neutral-60">
|
||||
아이마켓코리아 B2B 구매협상 솔루션 · 공급사 포털
|
||||
negotium B2B 구매협상 솔루션 · 공급사 포털
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* 로그인 카드 */}
|
||||
<div className="w-full rounded-3xl border border-border/60 bg-white p-8 shadow-[0_4px_24px_rgba(0,0,0,0.04)]">
|
||||
<div className="w-full rounded-2xl border border-border bg-white p-8 shadow-sm">
|
||||
<h1 className="mb-6 text-center text-xl font-bold tracking-[-0.4px] text-neutral-90">
|
||||
로그인
|
||||
</h1>
|
||||
<LoginForm />
|
||||
</div>
|
||||
|
||||
{/* 푸터 */}
|
||||
<p className="text-xs font-medium text-neutral-60">
|
||||
문의: 헬프데스크 010-0000-0000 · o2odev@o2o.kr
|
||||
</p>
|
||||
{/* 푸터 — 문의처 + 솔루션/제작사 표기(회사 브랜딩과 무관하게 고정) */}
|
||||
<div className="flex flex-col items-center gap-1">
|
||||
<p className="text-xs font-medium text-neutral-60">
|
||||
문의: 헬프데스크 010-0000-0000 · o2odev@o2o.kr
|
||||
</p>
|
||||
<p className="text-[11px] font-medium text-neutral-50">
|
||||
© {new Date().getFullYear()} negotium · Made by AI O2O
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user