| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
- <title>登录</title>
- <meta name="keywords">
- <meta name="description">
- <meta name="renderer" content="webkit">
- <!--<link rel="shortcut icon" href="./img/32.ico" />-->
- <link rel="stylesheet" href="./css/init.css" />
- <script src="./Script/Common/huayi.load.js"></script>
- <script src="./Script/Common/huayi.config.js"></script>
- <script src="./js/jquery.md5.js"></script>
- <script src="./js/purify.min.js"></script>
- <script src="./js/aes/crypto-js.js"></script>
- <script src="./js/sm2/sm2.js"></script>
- <script src="./js/sm2/decrypt.js"></script>
- <style>
- html {
- margin: 0 auto;
- padding: 0;
- height: 100%;
- }
-
- body {
- height: 100%;
- background: #fff;
- }
-
- .wrap {
- width: 100%;
- height: 100%;
- }
-
- .wrap_right {
- float: left;
- width: 50%;
- height: 100%;
- }
-
- .wrap_left {
- float: left;
- width: 50%;
- height: 100%;
- }
-
- .wrap_right {
- position: relative;
- }
-
- .wrap_bj {
- width: 100%;
- height: 100%;
- background: url(img/left_amg_01.jpg) no-repeat;
- background-size: 100% 100%;
- }
-
- .tab_box {
- border: 1px solid #41caf2;
- border-top-right-radius: 15px;
- border-bottom-left-radius: 15px;
- margin: 50px auto 65px;
- padding: 0;
- overflow: hidden;
- width: 410px;
- }
-
- .tab_box ul {
- list-style: none;
- margin: 0;
- padding: 0;
- width: 100%;
- height: 50px;
- line-height: 50px;
- font-size: 16px;
- color: #41caf2;
- border-bottom: 1px solid #41caf2;
- text-align: center;
- }
-
- .tab_box ul li {
- width: 50%;
- float: left;
- }
-
- .active {
- background: #41caf2;
- color: #fff;
- }
-
- .tab_content {
- margin: 57px 0 35px 0;
- }
-
- .tab_content div p {
- width: 80%;
- margin: 0 auto;
- height: 35px;
- border: 1px solid #41caf2;
- border-radius: 15px;
- margin-bottom: 25px;
- line-height: 30px;
- padding-left: 20px;
- }
-
- .tab_content div p input {
- width: 75%;
- border: 0;
- font-size: 16px;
- outline: none;
- font-family: "仿宋", "宋体";
- }
-
- .login_icon {
- display: inline-block;
- width: 17px;
- height: 19px;
- vertical-align: middle;
- margin-right: 15px;
- }
-
- .login_icon_user {
- background: url(img/login_user.png) no-repeat;
- }
-
- .login_icon_lock {
- background: url(img/login_lock.png) no-repeat;
- }
-
- .login_icon_hua {
- background: url(img/login_hua.png) no-repeat;
- }
-
- .login_go {
- text-align: center;
- padding: 0 !important;
- font-size: 16px;
- letter-spacing: 16px;
- font-family: "仿宋", "宋体";
- color: #fff;
- filter: progid:DXImageTransform.Microsoft.gradient(startcolorstr=#1f90ec, endcolorstr=#1cb5ef, gradientType=1);
- background: -webkit-gradient(li near, 0 0, 100% 0, from(#1f90ec), to(#1cb5ef));
- background: -webkit-linear-gradient(left, #1f90ec, #1cb5ef);
- background: -moz-linear-gradient(left, #1f90ec, #1cb5ef);
- background: -o-linear-gradient(left, #1f90ec, #1cb5ef);
- background: linear-gradient(left, #1f90ec, #1cb5ef);
- cursor: pointer;
- }
-
- .error {
- height: 13px;
- background: url(img/yz.png) no-repeat 0 -8px;
- display: none;
- }
-
- .errorShow {
- display: inline-block;
- }
-
- .rightCon {
- width: 100%;
- position: absolute;
- top: 0;
- bottom: 0;
- right: 0;
- left: 0;
- margin: auto;
- height: 580px;
- }
-
- .leftCon {
- width: 30%;
- position: absolute;
- top: 41%;
- bottom: 0;
- right: 0;
- left: 50%;
- margin: auto;
- }
-
- .leftCon img {
- width: 100%;
- }
-
- .leftCon p {
- font-size: 28px;
- letter-spacing: 10px;
- color: #e60111;
- line-height: 80px;
- }
-
- .service {
- width: 100%;
- position: absolute;
- bottom: 30px;
- }
-
- .tab_content div p {
- width: 80%;
- margin: 0 auto;
- height: 35px;
- border: 1px solid #41caf2;
- border-radius: 15px;
- margin-bottom: 20px;
- line-height: 30px;
- padding-left: 20px;
- }
-
- .tab_content div p .verification,
- .tab_content div p .verification_user {
- width: 50%;
- }
-
- .tab_content div p .btnVerifi,
- .tab_content div p .btnVerifi_user {
- width: 36.7%;
- border: 0;
- height: 33px;
- border-radius: 0px 15px 15px 0px;
- font-size: 16px;
- outline: none;
- font-family: "仿宋", "宋体";
- background: #41caf2;
- color: #FFFFFF;
- }
-
- input::-webkit-outer-spin-button,
- input::-webkit-inner-spin-button {
- -webkit-appearance: none;
- }
-
- input[type="number"] {
- -moz-appearance: textfield;
- }
-
- .SMSreminder {
- color: #C4C4C5;
- /*font-family: "仿宋", "宋体";*/
- font-size: 12px;
- padding: 0 37px;
- }
- </style>
- </head>
- <body class="signin">
- <div class="wrap clearfix">
- <div class="wrap_left" style="position: relative;">
- <div class="wrap_bj"></div>
- <div class="leftCon">
- <img src="img/logintext.png" />
- </div>
- </div>
- <div class="wrap_right">
- <div class="rightCon">
- <div class="logo" style="width: 100%;text-align: center;"></div>
- <div class="tab_box">
- <ul class="clearfix tab_ul">
- <li class="active">坐席登录</li>
- <li>用户登录</li>
- </ul>
- <div class="tab_content">
- <div class="tab_one">
- <p>
- <i class="login_icon login_icon_user "></i>
- <input class="zx_user" type="text" placeholder="请输入您的管理账号" />
- <i class="login_icon error error_zx error_zx_user"></i>
- </p>
- <p>
- <i class="login_icon login_icon_hua "></i>
- <input class="zx_fj" type="text" placeholder="请输入分机号" />
- <i class="login_icon error error_zx error_zx_fj"></i>
- </p>
- <p>
- <i class="login_icon login_icon_lock "></i>
- <input class="zx_psw" type="password" placeholder="请输入您的密码" />
- <i class="login_icon error error_zx error_zx_psw"></i>
- </p>
- <p>
- <i class="login_icon login_icon_hua "></i>
- <input class="verification" type="number" placeholder="请输入验证码" />
- <button class="btnVerifi" type="button">获取验证码</button>
- </p>
- <p class="login_go login_zx">登录</p>
- <div class="SMSreminder">出于12345平台数据安全的考虑,现需要在账号登录环节增加手机短信验证。如果账号未关联手机号,请致电联系5116015。密码或者短信验证码连续输入错5次就锁定账号,需要管理员角色来解锁。</div>
- </div>
- <div class="tab_two" style="display: none;">
- <p>
- <i class="login_icon login_icon_user "></i>
- <input class="gl_user" type="text" placeholder="请输入您的管理账号" />
- <i class="login_icon error error_gl error_gl_user"></i>
- </p>
- <p>
- <i class="login_icon login_icon_lock"></i>
- <input class="gl_psw" type="password" placeholder="请输入您的密码" />
- <i class="login_icon error error_gl error_gl_psw"></i>
- </p>
- <p>
- <i class="login_icon login_icon_hua "></i>
- <input class="verification_user" type="text" placeholder="请输入验证码" />
- <button class="btnVerifi_user" type="button">获取验证码</button>
- </p>
- <p class="login_go login_gl">登录</p>
- <div class="SMSreminder">出于12345平台数据安全的考虑,现需要在账号登录环节增加手机短信验证。如果账号未关联手机号,请致电联系5116015。密码或者短信验证码连续输入错5次就锁定账号,需要管理员角色来解锁。</div>
- </div>
- </div>
- </div>
- <div class="service">
- <p style="color: #313c58; font-size: 12px;text-align: center;"></p>
- </div>
- </div>
- </div>
- </div>
- <script>
- $(function() {
- var a = 0;
- $('.tab_ul li').click(function() {
- $(this).addClass("active").siblings().removeClass("active");
- var index = $(this).index();
- a = index;
- $('.tab_content').children('div').eq(index).show().siblings().hide();
- })
- /*cook存储数据*/
- if($.cookie("username")) {
- //取值如果存在则赋值
- $(".gl_user").val($.cookie("user")); //用户名
- $("zx_fj").val($.cookie("fj"));
- $(".zx_user").val($.cookie("user"));
- }
- //键盘登录事件
- $('input').bind('keypress', function(event) {
- if(event.keyCode == "13") {
- if(a == 0) {
- $('.login_zx').trigger("click");
- } else {
- $(".login_gl").trigger("click");
- }
- }
- });
-
- $(".btnVerifi").click(function() {
- if(!$(".zx_user").val()) {
- layer.msg('请输入账号')
- return false;
- }
- var mobile = $(".zx_user").val();
- var zx_psw = DOMPurify.sanitize($(".zx_psw").val());
- var currenttime = CurentTime();
- var datatime = currenttime.split(' ')[1].split(':').join('')
- var pass = encryptFn($.md5(zx_psw))
- sendMsg(mobile, pass);
- })
-
- $(".btnVerifi_user").click(function() {
- if(!$(".gl_user").val()) {
- layer.msg('请输入账号')
- return false;
- }
- var mobile = $(".gl_user").val();
- var user_psw = DOMPurify.sanitize($(".gl_psw").val());
- var currenttime = CurentTime();
- var datatime = currenttime.split(' ')[1].split(':').join('')
- var pass = encryptFn($.md5(user_psw))
- sendMsg(mobile, pass);
- })
- //坐席登录
- $('.login_zx').click(function() {
- localStorage.setItem('loginPassword', $('.zx_psw').val())
- var zx_user = DOMPurify.sanitize($(".zx_user").val());
- var zx_fj = DOMPurify.sanitize($(".zx_fj").val());
- var zx_psw = DOMPurify.sanitize($(".zx_psw").val());
- if(zx_user == "" || zx_fj == "" || zx_psw == "") {
- $(".error_zx").addClass('errorShow');
- if(zx_user == "") {
- $(".zx_user").focus(function() {
- $(".error_zx").removeClass('errorShow');
- });
- } else {
- $(".error_zx_user").removeClass('errorShow');
- }
- } else {
- var currenttime = CurentTime();
- var datatime = currenttime.split(' ')[1].split(':').join('')
- var encrypted = encryptFn($.md5(zx_psw))
- /*请求后台*/
- $.cookie("extno", zx_fj);
- $.cookie("zx_user", zx_user);
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "/Login/login",
- dataType: 'json',
- async: true,
- data: {
- username: zx_user,
- extensionphone: zx_fj,
- LoginTime: currenttime,
- password: encrypted.toString(),
- Code: $(".verification").val()
- },
- success: function(data) {
- /*验证请求*/
- if(data.state == "success") {
- $.cookie("token", data.data.token, {
- expires: 7
- });
- $.cookie("extno", zx_fj, {
- expires: 7
- });
- $.cookie("zx_user", zx_user, {
- expires: 7
- });
- loginHref()
-
- }
- }
- });
- }
- })
- //用户登录
- $('.login_gl').click(function() {
- localStorage.setItem('loginPassword', $('.gl_psw').val())
- var gl_user = DOMPurify.sanitize($(".gl_user").val());
- var gl_psw = DOMPurify.sanitize($(".gl_psw").val());
- if(gl_user == "" || gl_psw == "") {
- $(".error_gl").addClass('errorShow');
- if(gl_user == "") {
- $(".gl_user").focus(function() {
- $(".error_gl").removeClass('errorShow');
- });
- } else {
- $(".error_gl_user").removeClass('errorShow');
- }
- } else {
- var currenttime = CurentTime();
- var datatime = currenttime.split(' ')[1].split(':').join('')
- var encrypted = encryptFn($.md5(gl_psw))
- /*请求后台*/
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "/Login/login",
- dataType: 'json',
- async: true,
- data: {
- username: gl_user,
- password: encrypted.toString(),
- LoginTime: currenttime,
- Code: $(".verification_user").val()
- },
- success: function(data) {
- /*验证请求*/
- if(data.state == "success") {
- $.cookie("token", data.data.token, {
- expires: 7
- });
- $.cookie("zx_user", gl_user, {
- expires: 7
- });
- loginHref()
-
- }
- //else{
- // $(".gl_user").val('');
- // $(".gl_psw").val('');
- //}
- }
- });
- }
- })
-
- function sendMsg(mobile, pass) {
- var currenttime = CurentTime();
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "Login/SendCode",
- async: true,
- dataType: 'json',
- data: {
- usercode: mobile,
- Password: pass,
- LoginTime:currenttime
- },
- success: function(data) {
- if(data.state == "success") {
- layer.msg('发送成功')
- verifi();
- }
- }
- });
- }
- function verifi() {
- var time = 60;
- var timer = null;
- $('.btnVerifi').text(time + '秒后重新发送');
- $('.btnVerifi').attr('disabled', 'disabled'); // 禁用按钮
- $('.btnVerifi_user').text(time + '秒后重新发送');
- $('.btnVerifi_user').attr('disabled', 'disabled'); // 禁用按钮
- timer = setInterval(function() {
- // 定时器到底了 兄弟们回家啦
- if(time == 1) {
- clearInterval(timer);
- $('.btnVerifi').text("获取验证码")
- $('.btnVerifi_user').text('获取验证码')
- $('.btnVerifi').removeAttr('disabled')
- $('.btnVerifi_user').removeAttr('disabled')
- } else {
- time--;
- $('.btnVerifi').text(time + '秒后重新发送');
- $('.btnVerifi_user').text(time + '秒后重新发送');
- }
- }, 1000)
- }
-
- function CurentTime() {
- var now = new Date();
- var year = now.getFullYear(); //年
- var month = now.getMonth() + 1; //月
- var day = now.getDate(); //日
- var hh = now.getHours(); //时
- var mm = now.getMinutes(); //分
- var ss = now.getSeconds(); //秒
- var clock = year + "-";
- if(month < 10)
- clock += "0";
- clock += month + "-";
- if(day < 10)
- clock += "0";
- clock += day + " ";
- if(hh < 10)
- clock += "0";
- clock += hh + ":";
- if(mm < 10) clock += '0';
- clock += mm + ":";
- if(ss < 10) clock += '0';
- clock += ss;
- return(clock);
- }
-
- function loginHref(){
- var thisUrl = window.document.location.href
- var toHrefUrl =""
-
- if (thisUrl.indexOf("127.0.0.1") >0) {
- toHrefUrl = "home.html"
- } else{
- toHrefUrl = thisUrl.split('/')
- toHrefUrl.pop();
- toHrefUrl = toHrefUrl.join("/")+ "/home.html"
- }
- if (huayi.config.callcenter_url.indexOf("https") !==-1) {
- $.getJSON(
- huayi.config.callcenter_url + "UserAccount/GetNowUser", {
- token: $.cookie("token"),
- },
- function(result) {
- if(result.state.toLowerCase() == "success") {
- if (result.data.role.F_RoleCode ==="spdbzy") {
- toHrefUrl = "https://12345rx.zwfw.anyang.gov.cn/home.html"
- }else{
- toHrefUrl = "http://12345rx.zwfw.anyang.gov.cn/home.html"
- }
- window.location.href = toHrefUrl;
- }
- })
- }else{
- window.location.href = toHrefUrl;
- }
- }
- })
- </script>
- </body>
- </html>
|