Skip to content

Commit

Permalink
Hotfix/#71/jaeguk (#72)
Browse files Browse the repository at this point in the history
* fix: refresh토큰 만료시간 6시간으로 조정

* feat: 마일리지 관련 팁 데이터 변경

* fix: 회원가입 완료시 confirm이 아닌 alert로 알림

* fix: 내 글 목록에서 글쓰기 버튼시 Not Found로 가는 버그 해결

* style: MapCard 컴포넌트 스타일링 변경

* feat: 기업회원 회원가입 추가

* feat: 사업자 등록번호 key registNum으로 통일

* chore: 불필요한 import 제거

* feat: 헤더 NavBar 클릭 시 대표 페이지로 이동
  • Loading branch information
jk6722 authored Nov 22, 2023
1 parent e7bad7f commit 98fce9d
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Axios.interceptors.request.use(
localStorage.setItem('expireToken', newExpireTime.toString());

Cookies.remove('refreshToken');
Cookies.set('refreshToken', newRefreshToken, { expires: 1 });
Cookies.set('refreshToken', newRefreshToken, { expires: 0.24 });
}
}
return config;
Expand Down
22 changes: 17 additions & 5 deletions src/apis/signup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,30 @@ export const postSignup = async (
try {
switch (isGeneralUser) {
case true:
const res = await Axios.post('/users/register/user', postData, {
const res_user = await Axios.post('/users/register/user', postData, {
headers: {
'Content-Type': 'multipart/form-data',
},
});
if (
res?.data?.code === 200 &&
window.confirm('회원가입이 완료되었습니다!')
)
if (res_user?.data?.code === 200) {
window.alert('회원가입이 완료되었습니다!');
navigate('/login');
}
break;
case false:
const res_admin = await Axios.post(
'/users/register/manager',
postData,
{
headers: {
'Content-Type': 'multipart/form-data',
},
},
);
if (res_admin?.data?.code === 200) {
window.alert('회원가입이 완료되었습니다!');
navigate('/login');
}
break;
}
} catch (e) {
Expand Down
10 changes: 10 additions & 0 deletions src/assets/icons/icon-finger-one.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/icons/icon-finger-two.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Header = () => {
imageUrl: '',
role: '',
profileImageUrl: '',
registrationNum: '',
registNum: '',
department: '',
birth: '',
});
Expand Down Expand Up @@ -70,8 +70,13 @@ const Header = () => {
>
<img src={Logo} alt="character" />
</LogoWrapper>
{HeaderData.map(({ main, dropDowns }) => (
<NavBar key={main}>
{HeaderData.map(({ main, mainLink, dropDowns }) => (
<NavBar
key={main}
onClick={() => {
navigate(`${mainLink}`);
}}
>
<H3 $fontColor="#15191D">{main}</H3>
<Dropdown>
{dropDowns.map(({ title, link }, index) => (
Expand Down
2 changes: 1 addition & 1 deletion src/constants/Admin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const DASHBOARD_FILTER = [

export const ADMIN_INFO_TAG: { [key: string]: string } = {
nickName: '기관명',
registrationNum: '사업자등록번호',
registNum: '사업자등록번호',
department: '담당부서명',
name: '담당자명',
loginId: '아이디',
Expand Down
5 changes: 5 additions & 0 deletions src/constants/Header/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ interface DropDown {

interface HeaderDataProps {
main: string;
mainLink: string;
dropDowns: DropDown[];
}

export const HeaderData: HeaderDataProps[] = [
{
main: '갈래 소개',
mainLink: '/about/gallae',
dropDowns: [
{
title: "'갈래' 소개",
Expand All @@ -28,6 +30,7 @@ export const HeaderData: HeaderDataProps[] = [
},
{
main: '프로그램',
mainLink: '/search?programType=전체',
dropDowns: [
{
title: '전체',
Expand All @@ -49,6 +52,7 @@ export const HeaderData: HeaderDataProps[] = [
},
{
main: '활동후기',
mainLink: '/review',
dropDowns: [
{
title: '전체',
Expand All @@ -70,6 +74,7 @@ export const HeaderData: HeaderDataProps[] = [
},
{
main: '자료실',
mainLink: '/archive',
dropDowns: [
{
title: '전체',
Expand Down
9 changes: 3 additions & 6 deletions src/constants/Mileage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ export const TipData: TipDataType[] = [
'회원가입만 해도, 100 마일리지를 드려요.',
'후기를 하나 작성할 때마다 20 마일리지를 드려요.',
'보고서를 하나 작성할 때마다 30 마일리지를 드려요.',
"내가 작성한 후기와 보고서가 '좋아요'를 받으면 5 마일리지를 드려요.",
],
},
{
title: '마일리지는 이렇게 모을 수 있어요!',
title: '마일리지는 이렇게 사용할 수 있어요!',
content: [
'회원가입만 해도, 100 마일리지를 드려요.',
'후기를 하나 작성할 때마다 20 마일리지를 드려요.',
'보고서를 하나 작성할 때마다 30 마일리지를 드려요.',
"내가 작성한 후기와 보고서가 '좋아요'를 받으면 5 마일리지를 드려요.",
'10 마일리지로 다른 사람들의 후기를 볼 수 있어요.',
'15 마일리지로 다른 사람들의 보고서를 볼 수 있어요.',
],
},
];
2 changes: 1 addition & 1 deletion src/pages/board/PostingList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const PostingList: React.FC<Props> = ({ postingList, linkType }) => {

<WritingButton
onClick={() => {
navigate('write');
navigate(`/${linkType}/write`);
}}
>
<B3Bold $fontColor="#fff">글쓰기</B3Bold>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/login/functions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const onLoginSuccess = (
imageUrl,
role,
profileImageUrl,
registrationNum,
registNum,
birth,
department,
} = res?.data?.result;
Expand All @@ -62,7 +62,7 @@ export const onLoginSuccess = (
Axios.defaults.headers.common['Authorization'] = `Bearer ${accessToken}`;

// refreshToken 쿠키에 저장
Cookies.set('refreshToken', refreshToken, { expires: 1 });
Cookies.set('refreshToken', refreshToken, { expires: 0.24 });

// localStroage에 토큰 만료시간 저장
const expireTime = new Date(currentTime.getTime() + 1 * 60 * 60 * 1000);
Expand All @@ -80,7 +80,7 @@ export const onLoginSuccess = (
phoneNumber,
role,
profileImageUrl,
registrationNum,
registNum,
birth,
department,
});
Expand Down
5 changes: 2 additions & 3 deletions src/pages/map/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ interface markerDataType {
longitude: number;
photoUrl: string;
programName: string;
recruitStartDate: string;
recruitEndDate: string;
remainDay: string;
userLikeCheck: boolean;
}

Expand Down Expand Up @@ -64,7 +63,7 @@ const MapPage = () => {
refetch={refetch}
cardRef={cardRef}
{...markerData[selected]}
period={`${markerData[selected].recruitStartDate}-${markerData[selected].recruitEndDate}`}
remainDay={markerData[selected].remainDay}
setIsModalOpen={setIsModalOpen}
setSelected={setSelected}
isLiked={markerData[selected].userLikeCheck}
Expand Down
8 changes: 4 additions & 4 deletions src/pages/map/components/MapCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import styled from 'styled-components';

import { B1Bold, B3 } from '../../../style/fonts/StyledFonts';
import { B1Bold } from '../../../style/fonts/StyledFonts';
import LikeButton from '@/components/Button/LikeButton';
import CloseIcon from '@/assets/icons/icon-close.svg';

Expand All @@ -11,7 +11,7 @@ interface Props {
id: number;
photoUrl: string;
programName: string;
period: string;
remainDay: string;
setIsModalOpen: React.Dispatch<React.SetStateAction<boolean>>;
setSelected: React.Dispatch<React.SetStateAction<number>>;
cardRef: React.RefObject<HTMLDivElement>;
Expand All @@ -23,7 +23,7 @@ const MapCard: React.FC<Props> = ({
id,
photoUrl,
programName,
period,
remainDay,
setIsModalOpen,
setSelected,
cardRef,
Expand Down Expand Up @@ -52,8 +52,8 @@ const MapCard: React.FC<Props> = ({
</ImageWrapper>
<BottomContainer>
<TextContainer>
<B1Bold $fontColor="#FF7D2C">{remainDay}</B1Bold>
<B1Bold $fontColor="#15191D">{programName}</B1Bold>
<B3 $fontColor="#8E9398">{period}</B3>
</TextContainer>
<LikeButton
isLike={isLike}
Expand Down
8 changes: 7 additions & 1 deletion src/pages/mileage/components/TipCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ import { TipData } from '@/constants/Mileage';
import { B2, H3 } from '@/style/fonts/StyledFonts';
import styled from 'styled-components';

import One from '@/assets/icons/icon-finger-one.svg';
import Two from '@/assets/icons/icon-finger-two.svg';

const TipCard: React.FC<{ index: number }> = ({ index }) => {
return (
<Container>
<IconWrapper>
<span>☝️</span>
<img src={index === 0 ? One : Two} alt="" />
</IconWrapper>
<H3 $fontColor="#000">{TipData[index].title}</H3>
<TipContainer>
Expand All @@ -29,6 +32,7 @@ const Container = styled.div`
justify-content: flex-start;
width: 637px;
height: 372px;
padding: 46px 51px;
flex-shrink: 0;
Expand Down Expand Up @@ -59,6 +63,8 @@ const TipContainer = styled.ul`
display: flex;
flex-direction: column;
align-items: flex-start;
padding-top: 20px;
gap: 10px;
> li {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/mileage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Mileage = () => {
</DropDownWrapper>
</FilterContainer>
<HistoryList histories={myPoint?.points} />
<PageBar page={page} setPage={setPage} maxPage={myPoint.totalPage} />
<PageBar page={page} setPage={setPage} maxPage={myPoint?.totalPage} />
</HistoryContainer>
{/* 마일리지 관련 팁 */}
<TipContainer>
Expand Down
2 changes: 1 addition & 1 deletion src/recoil/LoginAtom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const UserAtom = atom<UserInfoType>({
phoneNumber: '',
role: '',
profileImageUrl: '',
registrationNum: '',
registNum: '',
department: '',
birth: '',
},
Expand Down
2 changes: 1 addition & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export interface UserInfoType {
phoneNumber: string;
role: string;
profileImageUrl: string;
registrationNum: string;
registNum: string;
department: string;
birth: string;
}
Expand Down

0 comments on commit 98fce9d

Please sign in to comment.