본문 바로가기

전체 글82

20. 난이도 분류 ※난이도를 상/중/하로 분류※힌트 추가(글자 수, 연관 단어) -백엔드- model -  const mongoose = require("mongoose");const Schema = mongoose.Schema;const gameSchema = new Schema({ _id: { type: String, required: true }, title: { type: String, require: true, unique: true }, image: { type: String, require: true }, level: { type: String, require: true }, //난이도 length: { type: String, require: true }, //힌트 hint: { type: St.. 2024. 6. 14.
19. 종성 ' ' 제외, 쉼표(,) 추가 ※낱말 조합 게임에서 받침이 없는 단어일 시 종성 ' ' 제외하고 랜덤 나열※각 낱말마다 쉼표(,)를 붙혀 구분, 마지막 낱말은 쉼표(,) 제외 Game - import axios from "axios";import React, { useCallback, useEffect, useState } from "react";import "../../css/game.css";import Canvas from "../../component/Canvas";import Typing from "../../component/Typing";import { CHO, JUNG, JONG } from "../../component/Word";import { useNavigate } from "react-router-dom";fu.. 2024. 6. 7.
7. 인증코드 제한 시간 ※인증코드 제한 시간을 3분으로 지정해서 제한 시간이 지날 시 재발급 요청※인증 코드 페이지를 authInput.js 컴포넌트로 분리※localStorage에 사용자 정보를 저장해 서버로 보내는 코드 삭제   -하위 컴포넌트로 state를 전송하는 식으로 변경※회원가입 기능에도 이메일 인증코드 기능 추가    -이메일 오타 입력 시 가입되는 것을 방지※커뮤니티 페이지 삭제, 학습하기 페이지 추가※서버 메일 전송 코드를 util 파일로 분리 -백엔드- util - : 메일 전송 코드 util 파일로 분류const nodemailer = require("nodemailer");require("dotenv").config();module.exports = async (email, title, code) =>.. 2024. 6. 6.
6. 비밀번호 변경 새로운 비밀번호로 변경 -백엔드- controller - (...)//Post Change Password, /change_pwd : 비밀번호 변경const changePwd = asynchHandler(async (req, res) => { const { username, password, checkPassword } = req.body; const user = await User.findOne({ username }); if (password !== checkPassword) { return res.status(401).json({ message: "비밀번호가 일치하지 않습니다." }); } user.password = await bcrypt.hash(password, 10); //새 .. 2024. 5. 27.
5. nodemailer, 인증코드 nodemailer로 인증코드를 보내 비밀번호 찾기 기능 구현 -백엔드- ※nodemailer : node.js에서 이메일을 보낼 수 있게 해주는 애플리케이션 모듈>> npm install nodemailer //nodemailer 설치  : 송신할 이메일 주소 지정MAIL_USER = '발신자 이메일 주소'MAIL_PWD = '발신자 이메일 비밀번호' model - : 인증코드 document를 저장할 스키마 생성  -expires : document 만료 시간 지정const mongoose = require("mongoose");const Schema = mongoose.Schema;const AuthSchema = new Schema({ code: { //인증코드 type: String, .. 2024. 5. 27.
4. 아이디 찾기 ※이메일을 통해 사용자의 ID 찾기  -ID 찾기 페이지 추가  -로그인 페이지에 ID 찾기 페이지로 이동 버튼 추가  -Login.js, Register.js css 수정 -백엔드- controller - (...)//Post Find User_id, /find_id : ID 찾기const findId = asynchHandler(async (req, res) => { const { email } = req.body; //클라이언트에서 보낸 이메일 값을 받아옴 const user = await User.findOne({ email }); //클라이언트에서 보낸 이메일 값 document 확인 if (!user) { //document가 없을 경우 return res.status(401).js.. 2024. 5. 24.
3. 이메일, 정규 표현식 ※회원가입에 이메일 항목 추가※정규표현식으로 이메일 형식 검사※에러 사항을 alert 대신 input 하단에 표시되도록 수정 -백엔드- model - : email 추가const mongoose = require("mongoose");const Schema = mongoose.Schema;const UserSchema = new Schema({ username: { type: String, require: true, unique: true, }, password: { type: String, require: true, }, email: { //email 추가 type: String, require: true, }, imageScore: { type.. 2024. 5. 23.
18. 초성/중성/종성 파일 모듈화 -초성/중성/종성 배열을 외부 파일로 내보내서 관리 component - : 초성/중성/종성 배열 파일const CHO = ['ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', //초성 'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ']; const JUNG = ['ㅏ', 'ㅐ', 'ㅑ', 'ㅒ', 'ㅓ', 'ㅔ', 'ㅕ', //중성 'ㅖ', 'ㅗ', 'ㅘ', 'ㅙ', 'ㅚ', 'ㅛ', 'ㅜ', 'ㅝ', 'ㅞ', 'ㅟ', 'ㅠ', 'ㅡ', 'ㅢ', 'ㅣ']; const JONG = ['',.. 2024. 5. 20.