123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
- <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
- <script type="text/javascript">
- $( function(){
- $( "#ex_select" ).siblings('label').text( $( "#ex_select" ).children('option:selected').text() );
-
- $.validator.addMethod('selectcheck', function (value) {
- return (value != "0" );
- }, "" );
-
- $( "#loginForm" ).validate({
- rules : {
- id : {
- required: true
- },
- pw : {
- required: true
- },
- centerCode : {
- selectcheck : true
- }
- },
- errorPlacement: function( error, element ){
- if( element.attr( "name" ) == "centerCode" ) {
- $( "#errMsg" ).text( "생활센터를 선택해주세요" );
- } else if( element.attr( "name" ) == "id" || element.attr( "name" ) == "pw" ) {
- if( $( "#id" ).val().length == 0 ) {
- $( "#errMsg" ).text( "동호실번호 입력해주세요(동+호실)" );
- $( "#id" ).focus();
- } else if( $( "#pw" ).val().length == 0 ){
- $( "#errMsg" ).text( "생년월일 8자리를 입력해주세요." );
- $( "#pw" ).focus();
- }
- }
- },
- submitHandler: function(form) {
- getAjax( "./check", $("#loginForm").serialize(), function( data ){
- console.log("data -- > " + JSON.stringify(data));
- var resultCode = data.code;
- var resultMsg = data.message;
-
- if( data.code == "00" ) {
- localStorage.id = data.id;
- localStorage.pw = $( "#pw" ).val();
- localStorage.cc = data.cc;
- // if( isMobile() ) {
- // if( checkDevice() == "android" ) {
- // window.android.login(data.id, data.pw);
- // } else if( checkDevice() == "ios" ){
-
- // }
- // }
-
- location.replace( '/mobile/menu' );
- } else {
- $("#errMsg").text( resultMsg );
- };
- }, null, null );
- }
- });
-
- if (localStorage.getItem( "id" ) != null) {
- autoLogin();
- }
-
- });
- function autoLogin(){
- if( localStorage.getItem( "id" ) != null &&
- localStorage.getItem( "pw" ) != null &&
- localStorage.getItem( "cc" ) != null ) {
- $( "#centerList" ).val( localStorage.getItem( "cc" ) );
- $( "#id" ).val( localStorage.getItem( "id" ) );
- $( "#pw" ).val( localStorage.getItem( "pw" ) );
-
- $( "#submitBtn" ).trigger( "click" );
- }
- }
- </script>
- </head>
- <body>
- <div id="login">
- <div class="container">
- <div class="title">생활치료센터</br>비대면진료 서비스</div>
- <form id="loginForm" action="./check" method="post">
- <div class="login_box">
- <div class="visual">
- <img src="/resources/images/mobile/login_visual.png" />
- </div>
- <div class="form">
- <div class="part">
- <div class="selectbox">
- <label for="centerList">치료센터 선택</label>
- <select id="centerList" name="centerCode">
- <option value="0" selected>치료센터 선택</option>
- <c:forEach var="i" items="${centerList}">
- <option value="${i.centerCode}"> · <c:out value="${i.centerName}" /></option>
- </c:forEach>
- </select>
- </div>
- </div>
- <div class="part">
- <div class="input">
- <input type="text" id="id" name="id" class="login-id" placeholder="동호실번호" tabindex="1" maxlength="20" autocomplete="off" required>
- </div>
- </div>
- <div class="part">
- <div class="input">
- <input type="password" id="pw" name="pw" class="login-pw" placeholder="생년월일 8자리 (YYYYMMDD)" autocomplete="off" tabindex="2" autocomplete="off" maxlength="15" required>
- </div>
- </div>
- <div class="part">
- <div class="alert" id="errMsg"></div>
- </div>
-
- <div class="part">
- <div class="button">
- <!-- <button id="submitBtn">로그인</button> -->
- <button id="submitBtn" type="submit" class="btn btn-lg btn-primary">로그인</button>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- </body>
- </html>
|