已重命名1个文件
已添加1个文件
已修改9个文件
已删除1个文件
| | |
| | | ip varchar(30), |
| | | type smallint default 1, |
| | | status smallint default 1, |
| | | browser varchar(100), |
| | | descr varchar(100), |
| | | userid integer default 1, |
| | | optime timestamp(6) without time zone default now() |
| | | ) partition by range(optime); |
| | |
| | | comment on column lf.sys_login.ip is 'IPå°å'; |
| | | comment on column lf.sys_login.type is 'ç±»å«ï¼1-ç»å½,2-æ ¡éª,3-ç»åº'; |
| | | comment on column lf.sys_login.status is 'ç¶æï¼1-æå,0-失败'; |
| | | comment on column lf.sys_login.browser is 'æµè§å¨'; |
| | | comment on column lf.sys_login.descr is 'æè¿°'; |
| | | comment on column lf.sys_login.userid is 'ç»å½äººID'; |
| | | comment on column lf.sys_login.optime is 'ç»å½æ¶é´'; |
| | | |
| | |
| | | |
| | | import com.lf.server.controller.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.data.LoginEntity; |
| | | import com.lf.server.entity.data.UsersEntity; |
| | | import com.lf.server.entity.sys.LoginInfo; |
| | | import com.lf.server.entity.sys.Result; |
| | | import com.lf.server.entity.sys.User; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.data.LoginService; |
| | | import com.lf.server.service.data.UsersService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * ç¾åæ§å¶å¨ |
| | |
| | | public class SignController extends BaseController { |
| | | @Autowired |
| | | UsersService userService; |
| | | |
| | | @Autowired |
| | | LoginService loginService; |
| | | |
| | | /** |
| | | * è·³å°é¦é¡µ |
| | |
| | | * @return String |
| | | */ |
| | | @PostMapping(value="/login", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<String> login(@RequestBody UsersEntity user) { |
| | | public ResponseMsg<String> login(@RequestBody UsersEntity user, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (user == null) { |
| | | return fail("请è¾å
¥ç¨æ·ååå¯ç ï¼", null); |
| | |
| | | return fail("ç¨æ·åä¸åå¨ï¼", null); |
| | | } |
| | | |
| | | LoginEntity le = loginService.getNewLogin(user.getId(), req); |
| | | if (!user.getPwd().equals(ue.getPwd())) { |
| | | le.setStatus(0); |
| | | le.setDescr("å¯ç é误"); |
| | | loginService.insertLogin(le); |
| | | return fail("å¯ç 䏿£ç¡®ï¼", null); |
| | | } |
| | | le.setStatus(1); |
| | | loginService.insertLogin(le); |
| | | |
| | | return null; |
| | | } catch (Exception ex) { |
| | |
| | | |
| | | private int status; |
| | | |
| | | private String browser; |
| | | private String descr; |
| | | |
| | | private int userid; |
| | | |
| | |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getBrowser() { |
| | | return browser; |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setBrowser(String browser) { |
| | | this.browser = browser; |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | public int getUserid() { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.helper; |
| | | |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.sql.Timestamp; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * Web帮å©ç±» |
| | | * @author WWW |
| | | */ |
| | | public class WebHelper { |
| | | private final static String UNKNOWN = "unknown"; |
| | | |
| | | private final static String COMMA = ","; |
| | | |
| | | public static String getGuid() { |
| | | /** |
| | | * è·åGUID |
| | | */ |
| | | return UUID.randomUUID().toString(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·ip |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static String getIpAddress(HttpServletRequest request) { |
| | | String ip = request.getHeader("X-Forwarded-For"); |
| | | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("Proxy-Client-IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("WL-Proxy-Client-IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_X_FORWARDED_FOR"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_X_FORWARDED"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_X_CLUSTER_CLIENT_IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_CLIENT_IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_FORWARDED_FOR"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_FORWARDED"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_VIA"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("REMOTE_ADDR"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
| | | ip = request.getRemoteAddr(); |
| | | } |
| | | if (ip.contains(COMMA)) { |
| | | return ip.split(",")[0]; |
| | | } |
| | | |
| | | return ip; |
| | | } |
| | | |
| | | /** |
| | | * è·åå½åæ¶é´çTimestamp |
| | | */ |
| | | public static Timestamp getCurrentTimestamp() { |
| | | return new Timestamp(System.currentTimeMillis()); |
| | | } |
| | | |
| | | /** |
| | | * è·åå½åæ¶é´æå®åéæ°åçTimestamp |
| | | * |
| | | * @param min åéæ° |
| | | * @return |
| | | */ |
| | | public static Timestamp getTimestamp(int min) { |
| | | Calendar now = Calendar.getInstance(); |
| | | now.add(Calendar.MINUTE, min); |
| | | |
| | | return new Timestamp(now.getTimeInMillis()); |
| | | } |
| | | } |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.data.LoginEntity; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.mapper.data.LoginMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public List<LoginEntity> selectLoginAll() { |
| | | return loginMapper.selectLoginAll(); |
| | | } |
| | | |
| | | public LoginEntity getNewLogin(int userid, HttpServletRequest req) { |
| | | LoginEntity le = new LoginEntity(); |
| | | le.setAppid(1); |
| | | le.setIp(WebHelper.getIpAddress(req)); |
| | | le.setUserid(userid); |
| | | le.setOptime(WebHelper.getCurrentTimestamp()); |
| | | |
| | | return le; |
| | | } |
| | | } |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.data.LoginEntity; |
| | | import com.lf.server.entity.data.TokenEntity; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.mapper.data.TokenMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public List<TokenEntity> selectTokenAll() { |
| | | return tokenMapper.selectTokenAll(); |
| | | } |
| | | |
| | | public TokenEntity getNewToken(int userid, HttpServletRequest req) { |
| | | TokenEntity te=new TokenEntity(); |
| | | te.setToken(WebHelper.getGuid()); |
| | | te.setDuration(240); |
| | | te.setExpire(WebHelper.getTimestamp(240)); |
| | | te.setType(0); |
| | | te.setIp(WebHelper.getIpAddress(req)); |
| | | te.setCreateUser(userid); |
| | | |
| | | |
| | | return te; |
| | | } |
| | | } |
| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.data.LoginEntity; |
| | | import com.lf.server.entity.data.UsersEntity; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.mapper.data.UsersMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public List<UsersEntity> selectByPage(String uname, Integer limit, Integer offset) { |
| | | return usersMapper.selectByPage(uname,limit,offset); |
| | | return usersMapper.selectByPage(uname, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | <insert id="insertLogin" parameterType="com.lf.server.entity.data.LoginEntity"> |
| | | insert into lf.sys_login |
| | | (appid,ip,type,status,browser,userid,optime) |
| | | (appid,ip,type,status,descr,userid,optime) |
| | | values |
| | | (#{appid},#{ip},#{type},#{status},#{browser},#{userid},now()); |
| | | (#{appid},#{ip},#{type},#{status},#{descr},#{userid},now()); |
| | | </insert> |
| | | |
| | | <insert id="insertLogins" > |
| | | insert into lf.sys_login |
| | | (appid,ip,type,status,browser,userid,optime) |
| | | (appid,ip,type,status,descr,userid,optime) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator="," > |
| | | (#{item.appid},#{item.ip},#{item.type},#{item.status},#{item.browser},#{item.userid},now()) |
| | | (#{item.appid},#{item.ip},#{item.type},#{item.status},#{item.descr},#{item.userid},now()) |
| | | </foreach> |
| | | </insert> |
| | | |
| | |
| | | </delete> |
| | | |
| | | <update id="updateLogin"> |
| | | update lf.sys_login set appid=#{appid},ip=#{ip},type=#{type},status=#{status},browser=#{browser},userid=#{userid},optime=now() where id=#{id} |
| | | update lf.sys_login set appid=#{appid},ip=#{ip},type=#{type},status=#{status},descr=#{descr},userid=#{userid},optime=now() where id=#{id} |
| | | </update> |
| | | </mapper> |
| | |
| | | (token,duration,expire,type,ip,create_user,create_time) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator="," > |
| | | (#{item.token},#{item.duration},#{item.expire},#{item.type},#{item.ip},#{item.createUser}, now()) |
| | | (#{item.token},#{item.duration},#{item.expire},#{item.type},#{item.ip},#{item.createUser},now()) |
| | | </foreach> |
| | | </insert> |
| | | |
ÎļþÃû´Ó src/main/resources/static/css/JCXM_style.css ÐÞ¸Ä |
| | |
| | | background-color:#0eade0; |
| | | } |
| | | #div_foot{ |
| | | width:100%;text-align:center;color:white;font-size:18px;position:fixed;bottom:10px;/*top:897px;position:absolute;background-color:#0eade0;*/ |
| | | width:100%;text-align:center;color:white;font-size:18px;position:fixed;bottom:10px; |
| | | } |
| | | |
| | | /*===========================ç»å½çé¢=========================*/ |
| | | /* ç»å½çé¢ */ |
| | | .loginheader,.loginmain,.regisheadermain{width:774px;margin-left:auto;margin-right:auto;} |
| | | .loginheader,.regisheadermain{height:50px;background:url(../images/login/loginuser.png) no-repeat;background-position:left; text-indent:50px;line-height:55px;} |
| | | .loginmain{height:1080px;background-repeat:no-repeat;background-position:center bottom;} |
| | |
| | | .code{width:65px !important;height:30px !important;font-size:22px !important;border-radius:0px !important;line-height: 29px !important;} |
| | | input::-webkit-input-placeholder {color: white;} |
| | | |
| | | /*==========================注å==========================*/ |
| | | /* 注å */ |
| | | .regisheader{width:100%;height:63px;border-bottom:3px solid #9BD4BC;margin-top:23px;} |
| | | .regisheadermain{margin-top:0px;} |
| | | .welregis{font-size:14px;} |
| | |
| | | |
| | | .departsel{width:255px;*width:205px;} |
| | | |
| | | /*=================个人ä¸å¿===================*/ |
| | | /* 个人ä¸å¿ */ |
| | | .grzxtab{width:767px;height:30px;margin-top:20px;margin-left:auto;margin-right:auto;border-bottom:1px solid #9DD5BD;} |
| | | .grzxtab ul li{list-style-type:none;font-family:微软é
é»;font-size:14px;color:#4f4e4e;min-width:105px;width:auto;height:30px; text-align:center;line-height:33px;padding:0px 10px 0px 10px;cursor:pointer;margin-left:12px;display:inline-block;*display:inline;zoom:1;} |
| | | .tabNormal{border-top:1px solid #CCCCCC;border-left:1px solid #CCCCCC;border-right:1px solid #CCCCCC;} |
| | |
| | | .qrxgbtn{background:url(../images/login/qrxg.png) no-repeat;margin-top:35px;margin-left:320px;} |
| | | .qrxgbtn:hover{background:url(../images/login/qrxg_hover.png) no-repeat} |
| | | |
| | | |
| | | /*====================ç»å½æå================*/ |
| | | /* ç»å½æå */ |
| | | .successmain{width:760px;min-height:200px;height:auto;padding-bottom:30px;background:#ffffff;border:1px solid #9DD5BD;margin-top:30px;margin-left:auto;margin-right:auto;font-family:微软é
é»;color:#ffffff;} |
| | | .imfordiv{width:730px;height:100px;background:#9DD5BD;position:relative;margin-top:15px;margin-left:auto;margin-right:auto;} |
| | | .imfordiv img{position:absolute;top:20px;left:50px} |
| | |
| | | .sysname:hover{background:#EBFAF4;border:1px solid #9DD5BD} |
| | | .sysname img{margin-left:10px;margin-right:10px;vertical-align:middle;} |
| | | |
| | | /* reset.css */ |
| | | a, abbr, acronym, address, applet, article, aside, audio, b, big, blockquote, body, canvas, caption, center, cite, code, dd, del, details, dfn, dialog, div, dl, dt, em, embed, fieldset, figcaption, figure, font, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, html, i, iframe, img, ins, kbd, label, legend, li, mark, menu, meter, nav, object, ol, output, p, pre, progress, q, rp, rt, ruby, s, samp, section, small, span, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, time, tr, tt, u, ul, var, video, xmp {border: 0;margin: 0;padding: 0;font-size: 100%;} |
| | | body {height: 100%;} |
| | | article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display: block;} |
| | | b, strong {font-weight: bold;} |
| | | img {color: transparent;font-size: 0;vertical-align: middle;-ms-interpolation-mode: bicubic;} |
| | | li {display: list-item;} |
| | | table {border-collapse: collapse;border-spacing: 0;} |
| | | th, td, caption {font-weight: normal;} |
| | | q {quotes: none;} |
| | | q:before, q:after {content: '';content: none;} |
| | | sub, sup, small {font-size: 75%;} |
| | | sub, sup {line-height: 0;position: relative;vertical-align: baseline;} |
| | | sub {bottom: -0.25em;} |
| | | sup {top: -0.5em;} |
| | | svg {overflow: hidden;} |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /* login.css */ |
| | | .code {font-family: Arial;font-style: italic;color: blue;font-size: 30px;border: 0;padding: 2px 3px;letter-spacing: 3px;font-weight: bolder;float: left;cursor: pointer;width: 88px;height: 35px;line-height: 34px;text-align: center;vertical-align: middle;border-top-right-radius: 5px;border-bottom-right-radius: 5px;background-color: white;} |
| | | a {text-decoration: underline;} a:hover {text-decoration: underline;} |
| | | |
| | |
| | | <link href="../favicon.ico" rel="icon" type="image/x-icon" /> |
| | | <link href="../css/reset.css" rel="stylesheet" /> |
| | | <link href="../css/JCXM_style.css" rel="stylesheet" /> |
| | | <link href="../js/font-awesome.min.css" rel="stylesheet" /> |
| | | <link href="../css/cas.css" rel="stylesheet" /> |
| | | <script src="../js/jquery.min.js"></script> |
| | | <script src="../js/zxcvbn.js"></script> |
| | | <script src="../js/jquery.cookie.min.js"></script> |
| | | <script src="../js/jquery-ui.min.js"></script> |
| | | <script src="../js/bootstrap.min.js"></script> |
| | | <script src="../js/rsa.min.js"></script> |
| | | <style> |
| | | .errorMessage_show { |
| | | width: 200px; |
| | | text-align: left; |
| | | line-height: 6px; |
| | | height: 6px; |
| | | clear: both; |
| | | color: #d56969; |
| | | font-size: 12px; |
| | | } |
| | | |
| | | .code { |
| | | font-family: Arial; |
| | | font-style: italic; |
| | |
| | | text-decoration: underline; |
| | | } |
| | | </style> |
| | | <script> |
| | | var code; |
| | | function createCode() { |
| | | code = ""; |
| | | var codeLength = 4; //éªè¯ç çé¿åº¦ |
| | | var checkCode = document.getElementById("checkCode"); |
| | | /* var codeChars = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, |
| | | 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', |
| | | 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); */ |
| | | var codeChars = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); |
| | | for (var i = 0; i < codeLength; i++) { |
| | | var charNum = Math.floor(Math.random() * 10); |
| | | code += codeChars[charNum]; |
| | | } |
| | | if (checkCode) { |
| | | checkCode.className = "code"; |
| | | checkCode.innerHTML = code; |
| | | } |
| | | } |
| | | </script> |
| | | </head> |
| | | <body style="background-color: #0059cf; overflow-y: hidden !important;"> |
| | | <form method="post" id="fm1" class="fm-v clearfix" action="/sign/login"> |
| | |
| | | <label for="password"></label> |
| | | <input class="required" placeholder="请è¾å
¥å¯ç " type="password" id="password" size="25" tabindex="2" |
| | | accesskey="p" autocomplete="off" name="password" value="" /><span id="capslock-on" style="display: none;"> |
| | | <i class="fa fa-exclamation-circle"></i> |
| | | <span>CAPSLOCK key is turned on!</span> |
| | | <i class="fa fa-exclamation-circle"></i> |
| | | <span>CAPSLOCK key is turned on!</span> |
| | | </span> |
| | | </div> |
| | | </section> |
| | |
| | | </section> |
| | | <!-- ç»å½æé® --> |
| | | <section> |
| | | <input class="loginbtn" style="margin-top: 25px;" name="submit" accesskey="l" value="" tabindex="5" type="submit"> |
| | | <input class="loginbtn" style="margin-top: 25px;" name="submit" accesskey="l" value="" tabindex="5" type="button" onclick="sysLogin();"> |
| | | </section> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </form> |
| | | <script> |
| | | var code; |
| | | function createCode() { |
| | | code = ""; |
| | | var codeLength = 4; //éªè¯ç çé¿åº¦ |
| | | var checkCode = document.getElementById("checkCode"); |
| | | /* var codeChars = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, |
| | | 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', |
| | | 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); */ |
| | | var codeChars = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); |
| | | for (var i = 0; i < codeLength; i++) { |
| | | var charNum = Math.floor(Math.random() * 10); |
| | | code += codeChars[charNum]; |
| | | } |
| | | if (checkCode) { |
| | | checkCode.className = "code"; |
| | | checkCode.innerHTML = code; |
| | | } |
| | | } |
| | | |
| | | var leftoffset = 474; |
| | | |
| | | // ç¦æ¢å¨iframeæå¼ |
| | | function noIframe() { |
| | | if (top.location != self.location) { |
| | | window.top.location = self.location.href.split("?")[0]; |
| | | } |
| | | } |
| | | |
| | | function myfocus() { |
| | | document.getElementById('username').focus(); |
| | | } |
| | | |
| | | window.onload = function () { |
| | | noIframe(); |
| | | createCode(); |
| | | //winResize(); |
| | | autoResize(); |
| | | $(window).on("resize", autoResize); |
| | | myfocus(); |
| | | } |
| | | |
| | | function winResize() { |
| | | $(window).on("resize", function () { |
| | | var div_obj = document.getElementById("div_middle"); |
| | | //宽度èªéåº |
| | | |
| | | //loginbox |
| | | var fullWidth = document.body.offsetWidth; |
| | | var div_loginBox = document.getElementById("div_loginBox"); |
| | | var boxWidth = div_loginBox.offsetWidth; |
| | | var myWidth = div_obj.offsetWidth; |
| | | //if (fullWidth > 1920) { |
| | | // fullWidth = 1920; |
| | | //} |
| | | div_obj.style.width = fullWidth + "px"; |
| | | div_loginBox.style.left = ((fullWidth - boxWidth) / 2 + leftoffset) + "px"; |
| | | |
| | | //logintitle |
| | | var div_loginTitle = document.getElementById("div_loginTitle"); |
| | | var titleWidth = div_loginTitle.offsetWidth; |
| | | div_loginTitle.style.left = (fullWidth - titleWidth) / 2 + "px"; |
| | | }) |
| | | } |
| | | |
| | | function autoResize() { |
| | |
| | | var div_loginBox = document.getElementById("div_loginBox"); |
| | | var boxWidth = div_loginBox.offsetWidth; |
| | | var myWidth = div_obj.offsetWidth; |
| | | //if (fullWidth > 1920) { |
| | | // fullWidth = 1920; |
| | | //} |
| | | //if (fullWidth > 1920) { fullWidth = 1920; } |
| | | |
| | | var winWidht = window.innerWidth; |
| | | var winHeight = window.innerHeight - 100; |
| | | var winHeight = window.innerHeight + 50; |
| | | var bgHeight = 1080; |
| | | winWidht += 150; |
| | | if (winWidht >= 1920) { |
| | | $("#div_middle").css("background", "url(../images/NewGJXJlogin/1920/2bg.jpg) no-repeat").css("background-position", "center bottom").css("height", "800px"); |
| | | $("#div_middle").css("height", "980px"); |
| | |
| | | $(".loginvalifield").css("margin-top", "20px").css("width", "350px").css("height", "45px"); |
| | | $("#inputCode").css("margin-left", "46px"); |
| | | $(".logintable").css("margin-top", "113px").css("width", "350px").css("height", "470px"); |
| | | //$(".logintable").css("margin-top", "210px").css("width", "350px").css("height", "470px"); |
| | | $("#carLink div").css("background", "url(../images/NewGJXJlogin/1600/add.png) no-repeat").css("background-position", "3% 40%"); |
| | | $("#carLink a").css("margin-left", "50px").css("font-size", "16px"); |
| | | $(".loginbtn").css("margin-top", "25px"); |
| | | leftoffset = 404; |
| | | bgHeight = 800; //900 |
| | | bgHeight = 800; |
| | | div_loginBox.style.left = ((fullWidth - 360) / 2 + leftoffset) + "px"; |
| | | } else if (winWidht >= 1440) { |
| | | $("#div_middle").css("background", "url(../images/NewGJXJlogin/1440/2bg.jpg) no-repeat").css("background-position", "center bottom").css("height", "810px"); |
| | |
| | | $(".loginvalicode input").css("width", "165px").css("margin-left", "46px").css("font-size", "14px"); |
| | | $(".loginvalifield").css("margin-top", "20px").css("width", "300px").css("height", "40px"); |
| | | $(".logintable").css("margin-top", "83px").css("width", "300px").css("height", "390px"); |
| | | //$(".logintable").css("margin-top", "135px").css("width", "300px").css("height", "390px"); |
| | | $("#carLink div").css("background", "url(../images/NewGJXJlogin/1366/add.png) no-repeat").css("background-position", "3.5% 50%").css("margin-top", "25px").css("height", "30px").css("line-height", "30px"); |
| | | $("#carLink a").css("margin-left", "50px").css("font-size", "14px"); |
| | | $(".loginbtn").css("margin-top", "10px").css("height", "56px"); |
| | | leftoffset = 338; |
| | | bgHeight = 668; //731 |
| | | bgHeight = 668; |
| | | div_loginBox.style.left = ((fullWidth - 300) / 2 + leftoffset) + "px"; |
| | | } else { |
| | | //fullWidth = 1280; |
| | | $("#div_middle").css("background", "url(../images/NewGJXJlogin/1280/2bg.jpg) no-repeat").css("background-position", "center bottom").css("height", "620px"); |
| | | $("#loginBox_Title").css("height", "50px").css("line-height", "50px"); |
| | | $("#loginBox_Title span").css("font-size", "32px"); |
| | |
| | | var marginTop = parseFloat($(".logintable").css("margin-top").replace("px")) + (winHeight - bgHeight); |
| | | $(".logintable").css("margin-top", marginTop + "px"); |
| | | } |
| | | //é«åº¦èªéåº |
| | | // é«åº¦èªéåº |
| | | var fullHeight = document.body.offsetHeight; |
| | | var myHeight = div_obj.offsetHeight; |
| | | if (fullHeight > myHeight) { |
| | |
| | | var div_loginTitle = document.getElementById("div_loginTitle"); |
| | | var titleWidth = div_loginTitle.offsetWidth; |
| | | div_loginTitle.style.left = (fullWidth - titleWidth) / 2 + "px"; |
| | | } |
| | | |
| | | //æ ¹æ®åæ°èªå¨æ¿æ¢æ é¢ãèæ¯å¾ç |
| | | var search = window.location.search; |
| | | if (search != "" && search.indexOf("=") > -1) { |
| | | search = decodeURIComponent(search); |
| | | var value = search.split('=')[1]; |
| | | if (value.length > 0) { |
| | | var startNum = value.indexOf("//"); |
| | | value = value.substring(startNum + 2, value.length); |
| | | var endNum = value.indexOf("/"); |
| | | if (endNum > -1) { |
| | | value = value.substring(0, endNum); |
| | | } |
| | | var k = value.indexOf(":"); |
| | | if (k > -1) { |
| | | value = value.substring(0, k); |
| | | } |
| | | var host = value; |
| | | |
| | | if (false) {//host == "10.3.1.37" |
| | | $("body").css("overflow", "auto"); |
| | | leftoffset = 375; |
| | | $("body").css("background-color", "#0eade0"); |
| | | $("#topBg").show(); |
| | | $("#div_loginTitle").show(); |
| | | $("#topBgColor").show(); |
| | | $("#loginBox_Title").hide(); |
| | | $("#carLink").hide(); |
| | | $("#otherCarLink").show(); |
| | | $(".loginid").css("margin-top", "20px").css("height", "40px").css("width", "279px").css("border-radius", "6px").css("background", "url(../images/GJXJlogin/icon_01.png) no-repeat").css("background-color", "#4987F4").css("background-position", "3% 50%").css("border-bottom", "none"); |
| | | $(".loginid input").css("width", "245px").css("margin-left", "33px").css("background-color", "#4987F4").css("color", "#c1d7fd").css("font-size", "14px"); |
| | | $(".loginpwd").css("margin-top", "20px").css("height", "40px").css("width", "279px").css("border-radius", "6px").css("background", "url(../images/GJXJlogin/icon_02.png) no-repeat").css("background-color", "#4987F4").css("background-position", "3% 50%").css("border-bottom", "none"); |
| | | $(".loginpwd input").css("width", "245px").css("margin-left", "33px").css("background-color", "#4987F4").css("color", "#c1d7fd").css("font-size", "14px"); |
| | | $(".loginvalicode").css("height", "40px").css("width", "210px").css("border-radius", "6px").css("background", "url(../images/GJXJlogin/icon_03.png) no-repeat").css("background-color", "#4987F4").css("background-position", "6% 50%"); |
| | | $(".loginvalicode input").css("width", "142px").css("margin-left", "37px").css("background-color", "#4987F4").css("color", "#c1d7fd").css("font-size", "14px"); |
| | | $(".loginvalifield").css("margin-top", "20px").css("width", "280px").css("border-bottom", "none"); |
| | | $("#checkCode").css("height", "40px").css("line-height", "40px"); |
| | | $(".loginbtn").css("background", "url(../images/GJXJlogin/login_btn.png) no-repeat").css("margin-top", "15px").css("height", "50px"); |
| | | titleWidth = div_loginTitle.offsetWidth; |
| | | $(".logintable").css("margin-top", "170px").css("width", "280px").css("height", "426px"); |
| | | div_loginTitle.style.left = (fullWidth - titleWidth) / 2 + "px"; |
| | | div_loginBox.style.left = ((fullWidth - 280) / 2 + leftoffset) + "px"; |
| | | $("#div_loginTitle").css("background", "url(../images/GJXJlogin/" + host + "_tit.png) no-repeat"); |
| | | $("#div_middle").css("background", "url(../images/GJXJlogin/" + host + "_bg.jpg) no-repeat"); |
| | | $("#div_middle").css("background-repeat", "no-repeat"); |
| | | $("#div_middle").css("background-position", "50% 110%"); |
| | | $("#div_middle").css("height", "863px"); |
| | | $("#checkCode").css("width", "94px"); |
| | | $("#checkCode").css("height", "40px"); |
| | | $("#topBgColor").css("background-color", "#3FD0FD"); |
| | | $("body").css("background-color", "#31b4ff"); |
| | | $("#div_foot").show(); |
| | | $("#div_foot").css("background-color", "#31b4ff"); |
| | | } |
| | | } |
| | | } |
| | | window.onload = function () { |
| | | noIframe(); |
| | | createCode(); |
| | | autoResize(); |
| | | $(window).on("resize", autoResize); |
| | | document.getElementById('username').focus(); |
| | | } |
| | | </script> |
| | | <script> |
| | | var i = "ç»å½ä¸..." |
| | | //表åæäº¤ |
| | | $("#fm1").submit(function () { |
| | | $("#eMsg").html(""); |
| | | function sysValidate() { |
| | | // éªè¯ç¨æ·åä¸å¯ç |
| | | var theUsername = document.getElementById("username").value; |
| | | if (theUsername.length <= 0) { |
| | |
| | | $("#inputCode").focus(); |
| | | return false; |
| | | } |
| | | else if (inputCode.toUpperCase() != code.toUpperCase()) { |
| | | if (inputCode.toUpperCase() != code.toUpperCase()) { |
| | | $("#eMsg").html("æç¤ºï¼éªè¯ç è¾å
¥æè¯¯ï¼"); |
| | | $("#inputCode").val("").focus(); |
| | | createCode(); |
| | | return false; |
| | | } |
| | | |
| | | //$("#uName").val(encrypt.encrypt(theUsername)); |
| | | //$("#uPwd").val(encrypt.encrypt(thePassword)); |
| | | |
| | | //$("#uName").val(Base64.encode(theUsername)); |
| | | $("#uName").val(theUsername); |
| | | $("#uPwd").val(Base64.encode(thePassword)); |
| | | |
| | | $(":submit").attr("disabled", true); |
| | | setTimeout(function () { |
| | | $(":submit").attr("disabled", false); |
| | | }, 5000); |
| | | //$(":submit").attr("value", i); |
| | | |
| | | return true; |
| | | }); |
| | | } |
| | | |
| | | function myLoginSubmit() { |
| | | var theSubmit = document.getElementById("misagh"); |
| | | theSubmit.submit(); |
| | | var isBusy = fase; |
| | | |
| | | function sysLogin() { |
| | | if (isBusy || !sysValidate()) { |
| | | return; |
| | | } |
| | | |
| | | var username = $.trim($("#username").val()); |
| | | var password = $("#password").val(); |
| | | var service = getQueryStr("service"); |
| | | |
| | | debugger |
| | | var data = { |
| | | "uid": username, |
| | | "pwd": password, |
| | | "bak": service |
| | | }; |
| | | |
| | | $.ajax({ |
| | | url: "sign/login", |
| | | type: "POST", |
| | | data: JSON.stringify(data), |
| | | dataType: "json", // htmlãjsonãjsonpãscriptãtext |
| | | contentType: "json", // "application/json", "application/x-www-form-urlencoded", |
| | | success: function (rs) { |
| | | alert(rs); |
| | | }, |
| | | error: function (e) { |
| | | console.error(e); |
| | | alert("ç»å½åºéï¼è¯·è系管çåï¼"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function ajax(url, type, data, dataType, contentType, fn, efn) { |
| | | $.ajax({ |
| | | url: url, |
| | | type: type, |
| | | data: data, |
| | | dataType: dataType || "json", // htmlãjsonãjsonpãscriptãtext |
| | | contentType: contentType || "application/json", // "application/x-www-form-urlencoded" |
| | | success: function (data) { |
| | | fn(data); |
| | | }, |
| | | error: function (e) { |
| | | console.error(e); |
| | | fn(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // è·åURLåæ° |
| | | function getQueryStr(name) { |
| | | var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); |
| | | var r = window.location.search.substr(1).match(reg); |
| | | if (r != null) { |
| | | return decodeURI(r[2]); |
| | | } |
| | | return null; |
| | | } |
| | | </script> |
| | | </body> |