Skip to content

Commit

Permalink
Merge pull request #98 from CAUCSE/develop
Browse files Browse the repository at this point in the history
[FEAT] 서비스 오픈 대비 유지보수 배포 4차 (운영계)
  • Loading branch information
selfishAltruism authored Mar 7, 2024
2 parents 059d593 + 093d31c commit 9608196
Show file tree
Hide file tree
Showing 76 changed files with 1,332 additions and 148 deletions.
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon-96x96.png" />
<meta name="description" content="중앙대학교 소프트웨어학부 학생회 홈페이지입니다. 공지사항, 학년별 게시판, 동아리 가입, 사물함 신청 등의 기능을 제공하여 소프트웨어 학생들의 불편함을 개선합니다.">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=5,viewport-fit=cover" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,viewport-fit=cover" />
<meta name="theme-color" content="#000000" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="color-scheme" content="light only"/>
<meta name="supported-color-schemes" content="light"/>
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" />
<link rel="stylesheet preload" as="style" href="https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap" />
Expand Down
20 changes: 13 additions & 7 deletions src/@types/user.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ declare namespace User {
name: string;
profileImage: string;
role: Role;
state: 'ACTIVE' | 'INACTIVE';
state: 'ACTIVE' | 'INACTIVE' | 'DROP' | 'INACTIVE_N_DROP';
studentId: string;
}

Expand All @@ -25,8 +25,6 @@ declare namespace User {
| 'LEADER_ALUMNI'
| 'COMMON'
| 'PROFESSOR'
| 'PRESIDENT_N_LEADER_CIRCLE'
| 'VICE_PRESIDENT_N_LEADER_CIRCLE'
| 'COUNCIL_N_LEADER_CIRCLE'
| 'LEADER_1_N_LEADER_CIRCLE'
| 'LEADER_2_N_LEADER_CIRCLE'
Expand Down Expand Up @@ -56,6 +54,7 @@ declare namespace User {
//#71 추가
userState: UserDto['state'];
}

export interface FindAllAdmissionsResponseDto {
content: AdmissionUserDto[];
last: boolean;
Expand Down Expand Up @@ -128,19 +127,21 @@ declare namespace User {

// findPrivilegedUsers
export interface FindPrivilegedUsersResponseDto {
presidentUsers: UserDto | null;
presidentUser: UserDto[];
vicePresidentUser: UserDto[];
councilUsers: UserDto[];
leaderGradeUsers: UserDto[];
leaderCircleUsers: UserDto[];
leaderAlumni: UserDto | null;
leaderAlumni: UserDto[];
}

export interface FindPrivilegedUsersResponse {
presidentUsers: Model.User | null;
presidentUser: Model.User[];
vicePresidentUser: Model.User[];
councilUsers: Model.User[];
leaderGradeUsers: Model.User[];
leaderCircleUsers: Model.User[];
leaderAlumni: Model.User | null;
leaderAlumni: Model.User[];
}

// ---
Expand Down Expand Up @@ -193,6 +194,11 @@ declare namespace User {
email: string;
}

export interface SignOutRequestDto {
accessToken: string;
refreshToken: string;
}

// ==

export interface FindPostsResponse {
Expand Down
5 changes: 5 additions & 0 deletions src/components/Atoms/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ export const NavButton = styled(Button)`
margin: 13px 0;
`;

export const NavSmallButton = styled(Button)`
margin: 13px 0;
font-size: 15px;
`;

const ClearButtonNative = styled('button')`
user-select: none;
padding: 0;
Expand Down
8 changes: 8 additions & 0 deletions src/components/StyledPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ export const PostProfileImage = styled.div`
}
`;

export const PostCouncilProfileImage = styled(PostProfileImage)`
border: 2px solid #312ed7;
`;

export const PostStudentLeaderProfileImage = styled(PostProfileImage)`
border: 2px solid #ff9100;
`;

export const PostAuthorNameCSS = css`
flex: 1 1 0;
Expand Down
15 changes: 10 additions & 5 deletions src/configs/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const API = axios.create({
export const setAccess = (token: string): unknown =>
(API.defaults.headers['Authorization'] = token);
export const resetAccess = (): unknown => delete API.defaults.headers['Authorization'];
export const getAccess = (): string => `${API.defaults.headers['Authorization']}`;

//Refresh
const storageRefreshKey = 'CAUCSE_JWT_REFRESH';
Expand Down Expand Up @@ -48,22 +49,26 @@ API.interceptors.response.use(
) {
removeRefresh();
if (location.pathname !== PAGE_URL.SignIn) location.href = PAGE_URL.SignIn;
} else if (data.errorCode === '4105') {
} else if (data.errorCode === '4105' || data.errorCode === 4105) {
const {
data: { accessToken, refreshToken },
data: { accessToken },
} = (await API.put(`/api/v1/users/token/update`, {
refreshToken: getRefresh(),
})) as AxiosResponse<{
accessToken: string;
refreshToken: string;
}>;

setAccess(accessToken);
removeRefresh();
storeRefresh(isStored, refreshToken);

config.headers['Authorization'] = accessToken;
return API.request(config);
} else if (
data.errorCode === '4107' ||
data.errorCode === 4107 ||
data.errorCode === '4000' ||
data.errorCode === 4000
) {
location.href = PAGE_URL.NoPermission;
}

return Promise.reject({
Expand Down
3 changes: 3 additions & 0 deletions src/configs/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export enum PAGE_URL {
SignUp = '/auth/signup',
FindPassword = '/auth/findPassword',
Admission = '/auth/admission',
UseTerms = '/auth/useTerms',
NoPermission = '/auth/noPermission',

Home = '/home',

Expand Down Expand Up @@ -38,6 +40,7 @@ export enum PAGE_URL {
SettingRoleLeaderCircle = '/setting/role/leader-circle',
SettingRoleAlumni = '/setting/role/alumni',
SettingRoleDelegation = '/setting/role/delegation',
SettingRoleVicePresident = '/setting/role/vice-president',
// SettingCircleBoards = '/setting/circle/boards',

// 내가 쓴 글, 댓글
Expand Down
4 changes: 4 additions & 0 deletions src/pages/auth/AuthPageSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Route, Switch } from 'react-router-dom';

import { Admission } from './admission';
import { FindPassword } from './findPassword';
import { NoPermission } from './NoPermission';
import { SignIn } from './signIn';
import { SignUp } from './signUp';
import { UseTerms } from './useTerms';

import { PAGE_URL } from '@/configs/path';

Expand All @@ -12,6 +14,8 @@ export const AuthPageSwitch: React.FC = () => (
<Route path={PAGE_URL.SignIn} component={SignIn} />
<Route path={PAGE_URL.Admission} component={Admission} />
<Route path={PAGE_URL.SignUp} component={SignUp} />
<Route path={PAGE_URL.UseTerms} component={UseTerms} />
<Route path={PAGE_URL.FindPassword} component={FindPassword} />
<Route path={PAGE_URL.NoPermission} component={NoPermission} />
</Switch>
);
39 changes: 39 additions & 0 deletions src/pages/auth/NoPermission/NoPermissionPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import styled from '@emotion/styled';
import { observer } from 'mobx-react-lite';
import React from 'react';

import { PageUiStoreImpl } from './NoPermissionPageUiStore';

import { BodyScreen, Header, PageBody, PageStoreHOC } from '@/components';
import { PAGE_URL } from '@/configs/path';

const NoPermissionPage: React.FC = observer(() => {
return (
<>
<Header withBack={PAGE_URL.Home} title="접근 불가" />
<PageBody>
<Wrapper>
<img src="/images/empty.png" alt="Empty list logo" />
<br />
페이지가 존재하지 않거나, 권한이 없습니다.
</Wrapper>
</PageBody>
</>
);
});

const Wrapper = styled.div`
margin: 160px 0 30px;
font-size: 17px;
//font-weight: bolder;
color: gray;
line-height: 12px;
text-align: center;
> img {
margin-bottom: 10px;
width: 100px;
}
`;

export default PageStoreHOC(<NoPermissionPage />, { store: PageUiStoreImpl });
9 changes: 9 additions & 0 deletions src/pages/auth/NoPermission/NoPermissionPageUiStore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { makeAutoObservable } from 'mobx';

export class NoPermissionPageUiStore {
constructor() {
makeAutoObservable(this, {}, { autoBind: true });
}
}

export const PageUiStoreImpl = new NoPermissionPageUiStore();
1 change: 1 addition & 0 deletions src/pages/auth/NoPermission/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as NoPermission } from './NoPermissionPage';
6 changes: 3 additions & 3 deletions src/pages/auth/admission/AdmissionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ const AdmissionPage: React.FC = observer(() => {
<BodyScreen>
<Guide>
중앙대학교 전산학과 / 컴퓨터공학과 / 소프트웨어학부임을 인증할 수 있는 자료를
첨부해주세요.
첨부해주세요. 변경이 불가능하니 주의하여 입력하세요.
<br />
<br />
예) 학생증, 졸업증명서, 포탈 내 개인정보 화면 캡처
(학번/이름이 포함되게 하여 학생증, 졸업증명서, 포탈 내 개인정보 화면 캡처 중 하나 기입)
</Guide>

<Label>사진 첨부</Label>
<ImageInput name="attachImage" />
<Label>설명 첨부</Label>
<Textarea
placeholder="설명을 첨부해주세요"
placeholder="사진에 대한 설명을 첨부해주세요"
{...methods.register('description')}
maxLength={254}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/auth/findPassword/FindPasswordPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const FindPasswordPage: React.FC = observer(() => {

return (
<>
<Header title="비밀번호 재발급" withBack={PAGE_URL.Board} />
<Header title="비밀번호 재발급" withBack={PAGE_URL.SignIn} />
<PageBody>
{isSubmitting ? (
<Loading />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/auth/signIn/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const SignInPage: React.FC = observer(() => {
</Form>

<SubLink>
<Link to={PAGE_URL.SignUp}>회원가입</Link>
<Link to={PAGE_URL.UseTerms}>회원가입</Link>
<Link to={PAGE_URL.FindPassword}>비밀번호를 잃어버리셨나요?</Link>
</SubLink>
</PageWrapper>
Expand Down
Loading

0 comments on commit 9608196

Please sign in to comment.