Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
chaeseungyun committed Jul 13, 2024
2 parents 34e62c6 + de33817 commit e6f1fbd
Show file tree
Hide file tree
Showing 156 changed files with 5,240 additions and 2,848 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ lerna-debug.log*
.env.development.local
.env.test.local
.env.production.local
.prettierrc

npm-debug.log*
yarn-debug.log*
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<link rel="apple-touch-icon" href="https://static.koreatech.in/assets/favicons/favicon-32x32.png" />
<link rel="shortcut icon" href="https://static.koreatech.in/assets/favicons/favicon-32x32.png">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<script async src="https://www.googletagmanager.com/gtag/js?id=G-B9VPQ37GNT"></script>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand All @@ -24,12 +23,13 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>코인 - 비즈니스</title>
<title>코인 사장님</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="text/javascript" src="https://openapi.map.naver.com/openapi/v3/maps.js?ncpClientId=%REACT_APP_NAVER_MAPS_CLIENT_ID%"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=%REACT_APP_GOOGLE_ANALYTICS_ID%"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
Expand Down
13 changes: 6 additions & 7 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import OwnerLayout from 'layout/OwnerLayout';
import CoopLayout from 'layout/CoopLayout';
import Login from 'page/Auth/Login';
import Signup from 'page/Auth/Signup';
import FindPassword from 'page/Auth/FindPassword/SendAuthNumber';
import NewPassword from 'page/Auth/FindPassword/NewPassword';
import CompleteChangePassword from 'page/Auth/FindPassword/CompleteChangePassword';
import AuthLayout from 'layout/AuthLayout';
import MyShopPage from 'page/MyShopPage';
import ShopRegistration from 'page/ShopRegistration';
Expand All @@ -22,6 +19,8 @@ import useUserTypeStore from 'store/useUserTypeStore';
import AddingEvent from 'page/ManageEvent/AddingEvent';
import ModifyEvent from 'page/ManageEvent/ModifyEvent';
import LogPage from 'component/common/PageLog';
import CommonLayout from 'page/Auth/components/Common';
import FindPassword from 'page/Auth/FindPassword';

interface ProtectedRouteProps {
userTypeRequired: UserType;
Expand Down Expand Up @@ -74,12 +73,12 @@ function App() {
<Route element={<AuthLayout />}>
<Route element={<ProtectedRoute userTypeRequired={null} />}>
<Route path="/login" element={<Login />} />
<Route path="/signup" element={<Signup />} />
<Route element={<CommonLayout />}>
<Route path="/signup" element={<Signup />} />
<Route path="/find-password" element={<FindPassword />} />
</Route>
<Route path="/find-id" element={<PageNotFound />} />
<Route path="/find-password" element={<FindPassword />} />
</Route>
<Route path="/new-password" element={<NewPassword />} />
<Route path="/complete-change-password" element={<CompleteChangePassword />} />
</Route>
</Routes>
<Toast />
Expand Down
23 changes: 23 additions & 0 deletions src/api/auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { accessClient, client } from 'api';
import {
CertificationResponse,
LoginParams, LoginResponse, OwnerResponse, UserTypeResponse,
} from 'model/auth';

Expand Down Expand Up @@ -34,3 +35,25 @@ export const findPassword = ({
});

export const newPassword = ({ address, password }: { address: string, password: string }) => client.put('/owners/password/reset', { address, password });

export const sendVerifyCode = (phone_number: string) => client.post('/owners/password/reset/verification/sms', {
phone_number,
});

export const verifyCode = ({ phone_number, certification_code } : { phone_number:string, certification_code:string }) => client.post<CertificationResponse>('/owners/password/reset/send/sms', {
phone_number, certification_code,
});

export const changePassword = ({ phone_number, password } : { phone_number:string, password:string }) => client.put('/owners/password/reset/sms', {
phone_number,
password,
});

export const loginByPhone = async (param: LoginParams) => {
const { data } = await client.post('/owner/login', {
account: param.account,
password: param.password,
});

return LoginResponse.parse(data);
};
23 changes: 16 additions & 7 deletions src/api/register/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
import { client, multipartClient } from 'api';
import {
AuthCodeParam,
PhoneNumberRegisterParam,
AuthCodeResponse,
EmailRegisterParam,
EmailRegisterResponse,
FilesResponse,
RegisterParam,
PhoneNumberRegisterResponse,
} from 'model/register';
import { RegisterUser } from 'model/auth';

export const getEmailDuplicate = async (param: string) => {
const { status } = await client.get(`/user/check/email?address=${param}`);
return status;
};

export const getEmailAuthCode = async (param: EmailRegisterParam) => {
const { data } = await client.post<EmailRegisterResponse>('/owners/verification/email', param);
return EmailRegisterResponse.parse(data);
};
// export const getEmailAuthCode = async (param: EmailRegisterParam) => {
// const { data } = await client.post<EmailRegisterResponse>('/owners/verification/email', param);
// return EmailRegisterResponse.parse(data);
// };

export const getPhoneAuthCode = async (param: PhoneNumberRegisterParam) => {
const { data } = await client.post<PhoneNumberRegisterResponse>('/owners/verification/sms', param);
return PhoneNumberRegisterResponse.parse(data);
};
export const verificationAuthCode = async (param:AuthCodeParam) => {
const { data } = await client.post<AuthCodeResponse>('/owners/verification/code', param);
const { data } = await client.post<AuthCodeResponse>('/owners/verification/code/sms', param);
return AuthCodeResponse.parse(data);
};

Expand All @@ -28,6 +33,10 @@ export const registerUser = async (param:RegisterParam) => {
return status;
};

export const phoneRegisterUser = async (param:RegisterUser) => {
const { status } = await client.post('/owners/register/phone', param);
return status;
};
export const getFileUrls = async (param:FormData, token:string) => {
multipartClient.defaults.headers.common.Authorization = `Bearer ${token}`;
const { data } = await multipartClient.post('/owners/upload/files', param);
Expand Down
3 changes: 3 additions & 0 deletions src/assets/svg/auth/checked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/svg/auth/delete-file.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e6f1fbd

Please sign in to comment.