| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 | <%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="utf-8"%><%@include file="/WEB-INF/ehr/commons/jsp/commonInclude.jsp" %><script>    var loginPage = {        init:function(){            var me = this;            $('#txtPassword').keydown(function(event){                if(event.which == "13")                    me.login();            });            $("#btnLogin").click(function(){                me.login();            });        },        login:function(){            var user = $("#txtUser").val();            var password = $("#txtPassword").val();            if(user.length == 0 || password.length ==0)            {                $.ligerDialog.error("用户名或密码不能为空!");                return;            }            $.ajax({ //获取表的字段列表                type: "POST",                url : "${contextRoot}/system/loginAction",                dataType : "json",                data:{user:user,password:password},                cache:false,                success :function(data){                    if(data.successFlg) {                        var tenantSession = data.data;                        localStorage.setItem("userRole",tenantSession.role);                        location.href = "${contextRoot}/indexPage";                    }                    else{                        $.ligerDialog.error(data.message);                    }                },                error :function(data){                    $.ligerDialog.error("Status:"+data.status +"(" +data.statusText+")");                }            });        }    };    $(function(){        var urlType = "${urlType}";        if(urlType != ''){            location.href = "${contextRoot}/"+urlType+"/loginPage";        }        //session过期        if(location.href.indexOf('loginPage')<0)        {            location.href = "${contextRoot}/loginPage";        }        //内嵌页面        if(self.location!=top.location)        {            <%--top.location.href = "${contextRoot}/loginPage";--%>            top.location.href = window.location;        }        loginPage.init();    });</script>
 |