Skip to content

Commit

Permalink
Merge pull request #203 from readyvery/test
Browse files Browse the repository at this point in the history
2/27 배포
  • Loading branch information
marinesnow34 authored Mar 26, 2024
2 parents 11e30dc + 7c1397d commit ce15d3d
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 111 deletions.
21 changes: 10 additions & 11 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Navigate, Route, Routes, useLocation } from "react-router-dom";
// import Header2 from "../src/components/views/Header/Header2";
// import Auth from "./hoc/auth.jsx";
import ApplicationForm from "./components/signup/ApplicationForm/ApplicationForm.jsx";
import Auth from "./hoc/Auth.jsx";
import FindIdPage from "./pages/Find/FindIdPage/FindIdPage.jsx"; //아이디 찾기-전화번호 인증
import NoneFindIdPage from "./pages/Find/FindIdPage/NoneFindIdPage/NoneFindIdPage.jsx"; //아이디 찾기 결과-회원 X
import UserFindIdPage from "./pages/Find/FindIdPage/UserFindIdPage/UserFindIdPage.jsx"; //아이디 찾기 결과-아이디 반환
Expand All @@ -22,24 +23,23 @@ import SignupPage from "./pages/Signup/SignupPage.jsx";
import TermsPage from "./pages/Signup/Terms/TermsPage.jsx";
import VerificationPage from "./pages/Signup/Verification/VerificationPage.jsx";
import StoreManage from "./pages/StoreManage/StoreManage.jsx";
import Auth from "./utils/Auth.jsx";

function App() {
//const [cookies, , removeCookies] = useCookies();
let location = useLocation();

// 로그인 필요없는 페이지
// sms인증 구현으로 인한 AUTH잠시 해제
// const NewSignupPage = Auth(SignupPage, false); // 회원가입
const NewSignupPage = Auth(SignupPage, false); // 회원가입
const NewLoginPage = Auth(LoginPage, false); // 로그인
// sms인증 구현으로 인한 AUTH잠시 해제
// const NewFindIdPage = Auth(FindIdPage, false); //아이디 찾기-전화번호 인증
const NewFindIdPage = Auth(FindIdPage, false); //아이디 찾기-전화번호 인증
const NewNoneFindIdPage = Auth(NoneFindIdPage, false); //아이디 찾기 결과-회원 X
const NewUserFindIdPage = Auth(UserFindIdPage, false); //아이디 찾기 결과-아이디 반환
const NewFindPasswordPage = Auth(FindPasswordPage, false); //비밀번호 찾기 - 아이디 조회
const NewChangeNewPasswordPage = Auth(ChangeNewPasswordPage, false); //비밀번호 변경 - 전화번호 인증
const NewChangePasswordPage = Auth(ChangePasswordPage, false); //비밀번호 변경 - 전화번호 인증
//const NewPhoneAuthPage = Auth(PhoneAuthPage, false); // 휴대폰 인증
const NewPhoneAuthPage = Auth(PhoneAuthPage, false); // 휴대폰 인증
const NewTermsPage = Auth(TermsPage, false); // 이용약관 페이지

// 로그인 필수 페이지
Expand All @@ -50,7 +50,7 @@ function App() {
const NewJudgeResultsRejectPage = Auth(JudgeResultsRejectPage, true, 3); // 입점 심사 반려 페이지
const NewMainPage = Auth(MainPage, true, 4); // 메인페이지 (4, 5)
const NewStoreManage = Auth(StoreManage, true, 4); // 매장관리 페이지 (4, 5)
// const NewOrderManagementPage = Auth(OrderManagePage, true, 5); // 주문관리
const NewOrderManagementPage = Auth(OrderManagePage, true, 5); // 주문관리
const NewInventoryPage = Auth(InventoryPage, true, 5); // 재고관리
const NewSalesPage = Auth(SalesManage, true, 5); // 매출관리
const NewMyPage = Auth(MyPage, true, 5); // 마이페이지
Expand All @@ -60,7 +60,7 @@ function App() {
<div>
<div className="App">
<Routes>
<Route path="/" element={<LoginPage />} />
<Route path="/" element={<NewLoginPage />} />
<Route path="/*" element={<Navigate to="/"></Navigate>}></Route>
</Routes>
</div>
Expand All @@ -73,13 +73,12 @@ function App() {
<Routes>
<Route path="/main" element={<NewMainPage />} />
<Route path="/store" element={<NewStoreManage />} />
<Route path="/order" element={<OrderManagePage />} />
<Route path="/order" element={<NewOrderManagementPage />} />
<Route path="/inventory" element={<NewInventoryPage />} />
<Route path="/sales" element={<NewSalesPage />} />
<Route path="/mypage" element={<NewMyPage />} />
<Route path="/signup" element={<SignupPage />} />
{/* 추가 */}
<Route path="/signup/auth/phone" element={<PhoneAuthPage />} />
<Route path="/signup" element={<NewSignupPage />} />
<Route path="/signup/auth/phone" element={<NewPhoneAuthPage />} />
<Route
path="/signup/auth/verification"
element={<NewVerificationPage />}
Expand All @@ -95,7 +94,7 @@ function App() {
element={<NewJudgeResultsRejectPage />}
/>
<Route path="/login" element={<NewLoginPage />} />
<Route path="/find/id" element={<FindIdPage />} />
<Route path="/find/id" element={<NewFindIdPage />} />
<Route path="/find/id/search" element={<NewUserFindIdPage />} />
<Route path="/find/id/none" element={<NewNoneFindIdPage />} />
<Route path="/find/password" element={<NewFindPasswordPage />} />
Expand Down
6 changes: 3 additions & 3 deletions src/components/UserReceipt.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import "./UserReceipt.css";

function UserReceipt(props) {
console.log(props);
const { foodies, idx, pickUp, time } = props;
const { foodies, orderNum, pickUp, time } = props;
return (
<Printer type="epson" width={42} characterSet="korea">
<Row left={`[${pickUp}]`} right="ReadyVery" />
<Row left={`[${pickUp === 1 ? '픽업' : '매장'}]`} right="ReadyVery" />
<Br />
<Text size={{ width: 3, height: 3 }} align="center" bold={true}>
{idx} {/*idx*/}
{orderNum} {/*orderNum*/}
</Text>
<Br />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useSendVerifySms from "../../../../hooks/useSendVerifySms";
import RedButton from "../../redButton/RedButton";
import CertificationNumInput from "../CertificationNumInput/CertificationNumInput";
import "./CertificationInput.css";
const TIMER_DURATION = 600; //타이머 시간 설정(600초)
const TIMER_DURATION = 180; //타이머 시간 설정(600초)

// 아이디찾기 및 회원가입 번호인증에 사용
function CertificationInput({ type, buttonText }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import RedButton from "../../redButton/RedButton";
import "../CertificationInput/CertificationInput.css";
import CertificationInputCheck from "./CertificationInputCheck";

const TIMER_DURATION = 600; //타이머 시간 설정(600초)
const TIMER_DURATION = 180; //타이머 시간 설정(600초)

// 비밀번호 변경 번호 인증_번호입력
// 추후 아이디 찾기 및 회원가입 번호인증과 비교 후 수정 필요
Expand All @@ -22,6 +22,7 @@ function CertificationInputPhoneNumber(userInfo) {
if (/^\d+$/.test(phonenumber) && phonenumber.length === 11) {
// 11자리 입력 후에
if (!postmessage) {
alert("인증번호를 발송했습니다. 인증번호가 오지 않으면 입력하신 정보가 회원정보와 일치하는지 확인해 주세요.")
handlePostmessage();
} else { //타이머 초기화용
setPostmessage(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useSendVerifySms from "../../../../hooks/useSendVerifySms";
import RedButton from "../../../login/redButton/RedButton";
import "./UserInputNumber.css";
import UserInputNumberMessage from "./UserInputNumberMessage/UserInputNumberMessage";
const TIMER_DURATION = 600; //타이머 시간 설정(600초)
const TIMER_DURATION = 180; //타이머 시간 설정(600초)

function PhoneCertificationInput() {
const [chkButton, setChkButton] = useState(false); // 인증버튼 클릭 여부
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const UserInputPassword = () => {
const handlePasswordChange = (e) => {
const newPassword = e.target.value;
setPassword(newPassword);
isPasswordCombinationValid(newPassword);
// isPasswordCombinationValid(newPassword);
};

const handlePasswordCheckChange = (e) => {
Expand All @@ -25,34 +25,36 @@ const UserInputPassword = () => {
validatePassword(password, newPasswordCheck);
};

const isPasswordLength = (password) => {
const minLength = 8;
return password.length >= minLength;
};
// const isPasswordLength = (password) => {
// const minLength = 8;
// return password.length >= minLength;
// };

const isPasswordCombinationValid = (password) => {
const hasLetter = /[a-zA-Z]/.test(password);
const hasNumber = /\d/.test(password);
const hasSpecialChar = /[!@#$%^&*(),.?":{}|<>]/.test(password);
return hasLetter && hasNumber && hasSpecialChar;
};
// const isPasswordCombinationValid = (password) => {
// const hasLetter = /[a-zA-Z]/.test(password);
// const hasNumber = /\d/.test(password);
// const hasSpecialChar = /[!@#$%^&*(),.?":{}|<>]/.test(password);
// return hasLetter && hasNumber && hasSpecialChar;
// };

const validatePassword = (newPassword, newPasswordCheck) => {
if (newPassword !== newPasswordCheck) {
setPasswordError(true);
} else if (!isPasswordLength(newPassword)) {
setPasswordError(true);
} else if (!isPasswordCombinationValid(newPassword)) {
setPasswordError(true);
} else {
// } else if (!isPasswordLength(newPassword)) {
// setPasswordError(true);
// } else if (!isPasswordCombinationValid(newPassword)) {
// setPasswordError(true);
// } else {
setPasswordError(false);
}
};
return(
<div className="signup-page-content-password-wrapper">
<label className="signup-page-content-password-label-style">비밀번호</label>
<div className="signup-page-content-password-label-plus-text">
영문+숫자+특수문자 8자 이상
{/* 영문+숫자+특수문자 8자 이상 */}
비밀번호를 입력해주세요
</div>
<div>
<input
Expand All @@ -79,10 +81,10 @@ const UserInputPassword = () => {
<LoginChkAlrm icon={"X"} paddingSize={"0.45rem"}>
{password !== confirmPassword
? "비밀번호가 일치하지 않습니다."
: !isPasswordLength(password)
? "8자 이상 입력해야 합니다."
: !isPasswordCombinationValid(password)
? "영문+숫자+특수문자의 조합이어야 합니다."
// : !isPasswordLength(password)
// ? "8자 이상 입력해야 합니다."
// : !isPasswordCombinationValid(password)
// ? "영문+숫자+특수문자의 조합이어야 합니다."
: null}
</LoginChkAlrm>
) : <div style={{minHeight: "0.9rem"}}/>
Expand Down
33 changes: 20 additions & 13 deletions src/components/views/Home/OrderContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function OrderContainer () {
// console.log(completeData);

const handleOrderMenu = (dummyInfo, e) => {
const selectedMenu = dummyInfo.orders.filter((order) => order.orderNum === e);
const selectedMenu = dummyInfo.orders.filter((order) => order.idx === e);
context.setSelectedMenu(e !== context.selectedIdx ? selectedMenu : {});
context.setSelectedIdx(e !== context.selectedIdx ? e : 0);
}
Expand All @@ -36,12 +36,12 @@ export default function OrderContainer () {
<OrderBoxWrapper>
{
waitData && waitData?.data?.orders?.map((item) => (
<span onClick={() => handleWaitOrderMenu(item.orderNum)}>
<span onClick={() => handleWaitOrderMenu(item.idx)}>
<OrderBox
id={item.orderNum}
category={item.pickUp}
menu={item.foodies}
clicked={item.orderNum === context.selectedIdx}
clicked={item.idx === context.selectedIdx}
/>
</span>
))
Expand All @@ -53,12 +53,12 @@ export default function OrderContainer () {
<OrderBoxWrapper>
{
makeData && makeData?.data?.orders?.map((item) => (
<span onClick={() => handleMakeOrderMenu(item.orderNum)}>
<span onClick={() => handleMakeOrderMenu(item.idx)}>
<OrderBox
id={item.orderNum}
category={item.pickUp}
menu={item.foodies}
clicked={item.orderNum === context.selectedIdx}
clicked={item.idx=== context.selectedIdx}
/>
</span>
))
Expand All @@ -70,12 +70,12 @@ export default function OrderContainer () {
<>
{
completeData && completeData?.data?.orders?.map((item) => (
<span onClick={() => handleCompleteOrderMenu(item.orderNum)}>
<span onClick={() => handleCompleteOrderMenu(item.idx)}>
<OrderBox
id={item.orderNum}
category={item.pickUp}
menu={item.foodies}
clicked={item.orderNum === context.selectedIdx}
clicked={item.idx === context.selectedIdx}
/>
</span>
))
Expand All @@ -90,6 +90,13 @@ const Container = styled.div`
width: 100%;
height: calc(100% - 60px);
overflow-y: auto;
// -ms-overflow-style: none; /* 인터넷 익스플로러 */
// scrollbar-width: none; /* 파이어폭스 */
// &::-webkit-scrollbar {
// display: none;
// }
`;

const OrderBoxContainer = styled.div`
Expand Down Expand Up @@ -118,10 +125,10 @@ const OrderBoxWrapper = styled.div`
overflow-y: auto;
padding-bottom: 50px;
-ms-overflow-style: none; /* 인터넷 익스플로러 */
scrollbar-width: none; /* 파이어폭스 */
// -ms-overflow-style: none; /* 인터넷 익스플로러 */
// scrollbar-width: none; /* 파이어폭스 */
&::-webkit-scrollbar {
display: none;
}
`;
// &::-webkit-scrollbar {
// display: none;
// }
`;
8 changes: 4 additions & 4 deletions src/components/views/Home/ReciptBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default function ReceiptBox ({children, modalIdx, setModalIdx}) {

// 주문 거부
const handleCancel = async (e) => {
// setLoading(1);
console.log(e);
message.loading("로딩 중...");

Expand All @@ -26,20 +25,21 @@ export default function ReceiptBox ({children, modalIdx, setModalIdx}) {
);

setModalIdx(0);
// setLoading(0);
context.setSelectedMenu({});
context.setSelectedIdx(0);
};

// 주문 접수
const handleMake = async (e) => {
// setLoading(2);
console.log(context?.selectedMenu);
message.loading("로딩 중...");

await acceptOrder(
`${context?.selectedMenu[0]?.orderId}@${e}`,
);
setModalIdx(0);
// setLoading(0);
context.setSelectedMenu({});
context.setSelectedIdx(0);
};

const selectedInfo = context.selectedMenu;
Expand Down
File renamed without changes.
File renamed without changes.
22 changes: 12 additions & 10 deletions src/hooks/Mypage/useMypageLogout.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { message } from "antd";
import axios from "axios";
import { useCookies } from "react-cookie";
import { useNavigate } from "react-router-dom";
import { useSetRecoilState } from "recoil";
import { isAuthenticatedState, loginState } from "../../Atom/status";
import { isAuthenticatedState } from "../../Atom/status";

// 수정필요! 백에서 로그아웃이 구현되면 ㄱㄱ
const apiRoot = process.env.REACT_APP_API_ROOT;
Expand All @@ -11,9 +12,9 @@ const apiUrl = `${apiRoot}/${apiVer}/user/logout`;

const useMypageLogout = () => {
const navigate = useNavigate();
const setIsLoggedIn = useSetRecoilState(loginState);
const token = localStorage.getItem("accessToken");
const setIsAuthenticated = useSetRecoilState(isAuthenticatedState);
const [, , removeCookie] = useCookies(["accessToken", "refreshToken", "JSESSIONID"]);
// 반환된 함수가 실제로 호출되면 로그아웃을 수행
const isTokenLogout = async () => {
// 로컬스토리지에 엑세스토큰 저장시에.
Expand All @@ -24,14 +25,15 @@ const useMypageLogout = () => {
};
try {
const response = await axios.get(apiUrl, config);
console.log(response);
setIsAuthenticated(false);
setIsLoggedIn({
accessToken: null,
expiredTime: null,
});
localStorage.removeItem("accessToken", "");
message.success("로그아웃에 성공하셨습니다.");
if(response.status === 200){
console.log(response);
setIsAuthenticated(false);
localStorage.clear();
removeCookie("JSESSIONID");
removeCookie("accessToken");
removeCookie("refreshToken");
message.success("로그아웃에 성공하셨습니다.");
}
navigate("/");
} catch (error) {
message.info("관리자에게 문의하세요.");
Expand Down
Loading

0 comments on commit ce15d3d

Please sign in to comment.