Lifesoft

login.ejs

파일 경로: views/login.ejs
코드 1
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>로그인</title>
    <link rel="stylesheet" href="/static/common.css" />
  </head>

  <body>
    <h2>로그인</h2>

    <form method="post">
      <input name="userid" placeholder="아이디" required />
      <br />
      <input name="pwd" type="password" placeholder="비밀번호" required />
      <br />
      <button type="submit">로그인</button>
      <button type="button" onclick="location.href='/member/register'">회원가입</button>
    </form>

    <% if (typeof msg !== 'undefined' && msg === 'fail') { %>
    <p style="color: red">로그인에 실패했습니다.</p>
    <% } else if (typeof msg !== 'undefined' && msg === 'logout') { %>
    <p style="color: red">로그아웃이 완료되었습니다.</p>
    <% } else if (typeof msg !== 'undefined' && msg === 'success') { %>
    <p style="color: red">회원가입이 완료되었습니다.</p>
    <% } else if (typeof msg !== 'undefined' && msg === 'authority') { %>
    <p style="color: red">접근 권한이 없습니다.</p>
    <% } %>
  </body>
</html>