Skip to content

Commit

Permalink
Merge pull request #102 from EmploymentRescueTeam/feature/#94
Browse files Browse the repository at this point in the history
Feat: mainpage ssr 구현
  • Loading branch information
LeHiHo authored Nov 21, 2023
2 parents 5bd2a08 + 46e2ca0 commit e53500a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### ✅ Work Flow

1. [ 기능 명세](https://www.notion.so/6017bafc0aca4b7ba1d2854b208efe39?pvs=21) 를 기반으로 `Issue` 생성
1. [기능 명세](https://www.notion.so/6017bafc0aca4b7ba1d2854b208efe39?pvs=21) 를 기반으로 `Issue` 생성
2. 생성한 `Issue` 번호로 로컬에서 브랜치 생성(feature/#이슈번호)
3. `dev`의 최신변경사항을 pull 받아서 동기화
4. 구현완료후 `dev`로 push후 Pull Request 생성
Expand Down
5 changes: 5 additions & 0 deletions src/api/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ export const postAuth = async (email: string, password: string) => {
return res;
};

// axios.get('https://example.com/api/data').then((response) => {
// const cookies = response.headers['set-cookie'];
// console.log(cookies);
// });

export const updateProductState = async (
productStateId: number | undefined,
changeStateCode: number,
Expand Down
18 changes: 17 additions & 1 deletion src/app/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import LoginPage from '@/templates/login/loginPage';
// import axios from 'axios';

// const client = axios.create({
// withCredentials: true,
// baseURL: process.env.NEXT_PUBLIC_BASE_URL,
// });
// export const postAuth = async (email: string, password: string) => {
// const res = await client.post('/login', {
// email: email,
// password: password,
// });
// return res.headers;
// };

export default async function Login() {
// const res = await postAuth('[email protected]', '123456');
// console.log(res['set-cookie']);

export default function Login() {
return (
<>
<LoginPage />
Expand Down
10 changes: 8 additions & 2 deletions src/templates/login/loginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { postAuth } from '@/api/service';

export default function LoginPage() {
// interface LoginPageProps {
// cookies: string[] | undefined;
// }

const LoginPage = () => {
const [email, setEmail] = useState<string>('');
const [password, setPassword] = useState<string>('');
const [isLogin, setIsLogin] = useState(false);
Expand Down Expand Up @@ -73,4 +77,6 @@ export default function LoginPage() {
</div>
</form>
);
}
};

export default LoginPage;

0 comments on commit e53500a

Please sign in to comment.