| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <!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" />
- <link rel="stylesheet" href="./css/login.css" />
- </head>
- <body class="signin">
- <div class="wrap clearfix">
- <div class="logoInfo clearfix">
- <img src="./img/logo.png" alt="" class="logoB">
- <span>伊川县政务服务便民热线</span>
- <!-- <h2>伊川县政务服务便民热线</h2> -->
- </div>
- <div class="rightCon">
- <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 class="login_go login_zx">登录</p>
- </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 class="login_go login_gl">登录</p>
- </div>
- </div>
- </div>
- <div class="service">
- <p style="color: #313c58; font-size: 12px;text-align: center;"></p>
- </div>
- </div>
- </div>
- <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/aes/crypto-js.js"></script>
- <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");
- }
- }
- });
- //坐席登录
- $('.login_zx').click(function() {
- var zx_user = $(".zx_user").val();
- var zx_fj = $(".zx_fj").val();
- var zx_psw = $(".zx_psw").val();
-
- const reg = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!#$%^&*])[\da-zA-Z!#$%^&*]{8,}$/
- if(reg.test(zx_psw)){
- sessionStorage.setItem('passTipShow' , false)
- }else{
- sessionStorage.setItem('passTipShow' , true)
- }
-
- if (zx_user == "" || zx_fj == "" || zx_psw == "") {
- $(".error_zx").addClass('errorShow');
- if ($(".zx_user").val() == "") {
- $(".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 key = CryptoJS.enc.Utf8.parse(")O[9d]6,YF}+efcaj{+8>Z'e9M" + datatime);
- var zx_psw = CryptoJS.enc.Utf8.parse($.md5(zx_psw));
- var encrypted = CryptoJS.AES.encrypt(zx_psw, key, {
- mode: CryptoJS.mode.ECB,
- padding: CryptoJS.pad.Pkcs7
- });
- /*请求后台*/
- $.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()
- },
- 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
- });
- window.location.href = "home.html";
- }
- }
- });
- }
- })
- 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);
- }
- //用户登录
- $('.login_gl').click(function() {
- debugger
- var gl_user = $(".gl_user").val();
- var gl_psw = $(".gl_psw").val();
- if (gl_user == "" || gl_psw == "") {
- $(".error_gl").addClass('errorShow');
- if ($(".gl_user").val() == "") {
- $(".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 key = CryptoJS.enc.Utf8.parse(")O[9d]6,YF}+efcaj{+8>Z'e9M" + datatime);
- var gl_psw = CryptoJS.enc.Utf8.parse($.md5(gl_psw));
- var encrypted = CryptoJS.AES.encrypt(gl_psw, key, {
- mode: CryptoJS.mode.ECB,
- padding: CryptoJS.pad.Pkcs7
- });
- /*请求后台*/
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "/Login/login",
- dataType: 'json',
- async: true,
- data: {
- username: gl_user,
- password: encrypted.toString(),
- LoginTime: currenttime
- },
- success: function(data) {
- /*验证请求*/
- if (data.state == "notoken") {
- layer.confirm('授权到期!', {
- btn: ['确定']
- });
- return;
- } else if (data.state == "success") {
- $.cookie("token", data.data.token, {
- expires: 7
- });
- $.cookie("zx_user", gl_user, {
- expires: 7
- });
- // window.location.href = "home.html";
- if (data.data.authdate) {
- layer.confirm('授权将于' + data.data.authdate +
- '到期,请及时联系本项目负责人!', {
- closeBtn: 0,
- btn: ['确定'] //按钮
- },
- function() {
- window.location.href = "home.html";
- });
- } else {
- // console.log(1111)
- window.location.href = "home.html";
- }
- }
- }
- });
- }
- })
- })
- </script>
- </body>
- </html>
|