| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376 |
- <!DOCTYPE html>
- <html lang="en"
- xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{home/common/common}">
- <head>
- <meta charset="UTF-8">
- <title>登录页</title>
- <style>
- html, body {
- height: 100%;
- }
- .icon-tips {
- display: inline-block;
- position: absolute;
- top: 5px;
- right: -26px;
- border: solid 1px #dadada;
- width: 20px;
- height: 20px;
- line-height: 20px;
- border-radius: 50%;
- color: #666;
- padding-left: 5px;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <link rel="stylesheet" th:href="@{/home/css/login.css}">
- <link rel="stylesheet" th:href="@{/home/plugin/bootstrap/css/bootstrap.css}">
- <script type="text/javascript" th:src="@{/h-ui/lib/jquery.validation/1.14.0/jquery.validate.min.js}"></script>
- <script type="text/javascript" th:src="@{/h-ui/lib/jquery.validation/1.14.0/validate-methods.js}"></script>
- <script type="text/javascript" th:src="@{/h-ui/lib/jquery.validation/1.14.0/messages_zh.js}"></script>
- <script type="text/javascript" th:src="@{/h-ui/static/h-ui/js/H-ui.min.js}"></script>
- <script type="text/javascript" th:src="@{/h-ui/static/h-ui.admin/js/H-ui.admin.js}"></script>
- <script type="text/javascript" th:src="@{/js/common/base.js}"></script>
- <!-- 头部导航 -->
- <div style="border-bottom: solid 2px #2976CE">
- <div th:replace="~{home/common/headerLogin :: headerLogin}"></div>
- </div>
- <!-- 主体内容 -->
- <!-- 主体内容 -->
- <div class="main" style="padding-bottom: 0;">
- <div class="container content projects" style="margin-top: 60px;">
- <div class="row">
- <div class="col-sm-6 col-md-6 col-lg-6 col-sm-offset-3 col-md-offset-3 col-lg-offset-3">
- <div class="page-container">
- <form action="" method="post">
- <div style="padding: 10px 30px 0px 30px;">
- <div style="position: relative;">
- <div class="input-group">
- <span class="input-group-addon" id="basic-addon1">
- <i class=" iconfont icon-yonghuming1"></i>
- </span>
- <input type="text" class="form-control" name="username" id="name"
- aria-describedby="sizing-addon1" placeholder="用户名">
- </div>
- <!--<span class="icon-tips" title="批量导入的企业账号为组织机构代码">?</span>-->
- </div>
- <div style="position: relative;">
- <div class="input-group">
- <span class="input-group-addon"><i class=" iconfont icon-mima"></i></span>
- <input type="password" name="password" class="form-control" placeholder="密码">
- </div>
- <!--<span class="icon-tips" title="批量导入的企业账号密码为组织机构代码后6位">?</span>-->
- </div>
- <button type="button" class="button login-btn"
- th:onclick="'javascript:onLine(\'/home/login\');'">登 录
- </button>
- <!--<button type="button" class="button"-->
- <!--th:onclick="'javascript:register(\'注册\',\'/home/toRegister\',\'800\',\'500\');'">注 册-->
- <!--</button>-->
- <!-- 20200703 注释老的注册功能-->
- <!-- <button type="button" class="button"
- th:onclick="'javascript:register(\'注册\',\'/home/chooseRegister\',\'800\',\'500\');'">注 册
- </button>-->
- <!-- 注释代码为注册功能维护中 -->
- <!--<button type="button" class="button"
- onclick="javascript:alert('注册功能维护中, 敬请谅解...');">注 册
- </button>-->
- <span style="color: #2976CE;text-decoration: underline;cursor: pointer;font-size: 15px; margin: 10px 0;"
- th:onclick="'javascript:reset(\'忘记密码\',\'/home/toReset\',\'800\',\'500\');'">忘记密码
- </span>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!--页底-->
- <div class="w1300 copyright" style="position: absolute; bottom: 0; width: 100%;">
- <span>苏州高新区经济发展委员会  保留版权所有</span>
- </div>
- <script th:inline="javascript">
- var base64 = new Base64();
- var pagePath = $("meta[name='_ctx']").attr("content");
- pagePath = pagePath.substring(0, pagePath.length - 1);
- var c_name = "DoNotAskAgain";
- function onLine(url) {
- var usernameObj = $("input[name = 'username']");
- var passwordObj = $("input[name = 'password']");
- var username = base64.encode($.trim(usernameObj.val()));
- var password = base64.encode($.trim(passwordObj.val()));
- var maskValue = "xxxxxxxxxxxxxxxxxxxxx".substring(0, password.length);
- $("input[name = 'password']").value = maskValue;
- $.ajax({
- type: "POST",
- dataType: "json",
- url: pagePath + url,
- data: {
- "username": username,
- "password": password,
- "timestamp": new Date().getTime()
- },
- beforeSend: function () {
- if (!username) {
- warningMessage("请输入用户名!");
- usernameObj.focus();
- return false;
- }
- if (!password) {
- warningMessage("请输入密码!");
- passwordObj.focus();
- return false;
- }
- }, success: function (result) {
- if (result.success) {
- // redirectToIndustrialCarrier();
- localStorage.setItem("user_name", result.obj.userName);
- localStorage.setItem("user_Type", result.obj.userType);
- localStorage.setItem("user_id", result.obj.userId);
- localStorage.setItem("INDUSTRIAL_CARRIER", result.obj.token);
- var safetySupervision = localStorage.getItem("safetySupervision");
- localStorage.removeItem("safetySupervision");
- var electricFurnaceMonitoring = localStorage.getItem("dljkxt");
- localStorage.removeItem("dljkxt");
- var lyjjjcpt = localStorage.getItem("lyjjjcpt");
- localStorage.removeItem("lyjjjcpt");
- var industrialCarrier = localStorage.getItem("industrialCarrier");
- localStorage.removeItem("industrialCarrier");
- var industrialLand = localStorage.getItem("industrialLand");
- localStorage.removeItem("industrialLand");
- var platformHome = localStorage.getItem("platformHome");
- localStorage.removeItem("platformHome");
- var requiredUserType = localStorage.getItem("requiredUserType");
- localStorage.removeItem("requiredUserType");
- var activityUrl = localStorage.getItem("activityUrl");
- localStorage.removeItem("activityUrl");
- var returnUrl = localStorage.getItem("returnUrl");
- localStorage.removeItem("returnUrl");
- var errorMsg = localStorage.getItem("errorMsg");
- localStorage.removeItem("errorMsg");
- //进入安监系统
- if (safetySupervision) {
- window.location.href = "http://202.102.20.60:8008/zf/#/login?username=" + result.obj.userName;
- return;
- }
- //进入电炉监控系统
- if (electricFurnaceMonitoring) {
- window.location.href = "http://202.102.20.60:8008/ly/#/login?username=" + result.obj.userName;
- return;
- }
- //进入楼宇经济监测平台首字母
- if (lyjjjcpt) {
- window.location.href = "http://112.4.85.47:8000/lyzf/#/login?username=" + result.obj.userName;
- return;
- }
- //进入工业厂房
- if (industrialCarrier) {
- window.location.href = pagePath.substring(0, pagePath.lastIndexOf("/")) + '/industry/home/#/home';
- // window.open(pagePath.substring(0,pagePath.lastIndexOf("/")) + '/industry/home/#/home');
- return;
- }
- //进入工业用地
- if (industrialLand) {
- window.open(pagePath.substring(0, pagePath.lastIndexOf("/")) + '/industry/home/#/industrialReserve');
- return;
- }
- //进入新门户首页
- if (platformHome) {
- window.location.href = pagePath + '/index';
- return;
- }
- //个人用户登录直接进入首页
- if (result.obj.userType === 5) {
- if (activityUrl) {
- window.location.href = activityUrl;
- return;
- }
- window.location.href = pagePath + '/index';
- return;
- }
- if (result.obj.firstLogin == null || result.obj.firstLogin == 0) {
- //第一次登录 取后台改密码
- window.location.href = pagePath + "/admin/home";
- //window.open(pagePath + "/admin/home");
- return;
- }
- smileMessage(result.message);
- if (activityUrl) {
- //只有某一类用户可以执行操作,比如门户项目申报只能企业用户申报
- if (requiredUserType) {
- if (requiredUserType == result.obj.userType) {
- window.location.href = activityUrl;
- return;
- } else {
- if (returnUrl) {
- sadMessage(errorMsg);
- window.location.href = returnUrl;
- return;
- } else {
- window.location.href = pagePath + "/home";
- return;
- }
- }
- } else {
- window.location.href = activityUrl;
- return;
- }
- }
- if (result.obj.firstLogin == 1 && result.obj.userType == 3) {
- localStorage.setItem("url", "/build/company/companyInfo")
- //window.location.href = pagePath + "/build/company/companyInfo";
- //return;
- }
- if (!result.obj.isComplete) {
- layer_show("完善信息", pagePath + "/home/toComplete", 800, 600);
- return;
- }
- window.location.href = pagePath + "/admin/home";
- //window.open(pagePath + "/admin/home");
- } else {
- sadMessage(result.message);
- }
- }
- });
- }
- function register(title, url, w, h) {
- var index = layer_show(title, pagePath + url, w, h);
- console.log("登录页:" + index);
- //默认全屏
- layer.full(index);
- }
- function reset(title, url, w, h) {
- layer_show(title, pagePath + url, w, h);
- }
- $("body").keydown(function () {
- if (event.keyCode == "13") {//keyCode=13是回车键
- $('.login-btn').trigger("click");
- }
- });
- function getCookie(c_name) {
- if (document.cookie.length > 0) {
- c_start = document.cookie.indexOf(c_name + "=")
- if (c_start != -1) {
- c_start = c_start + c_name.length + 1
- c_end = document.cookie.indexOf(";", c_start)
- if (c_end == -1) c_end = document.cookie.length
- return unescape(document.cookie.substring(c_start, c_end))
- }
- }
- return ""
- }
- if (!getCookie(c_name)) {
- layer.open({
- title: '提示!'
- , content: '建议使用chrome浏览器、ie8及以上浏览器访问'
- , btn: ['知道了', '不再提示']
- , yes: function (index, layero) {
- layer.close(index);
- }
- , btn2: function (index, layero) {
- document.cookie = c_name + "=true; expires=Fri, 31 Dec 9999 23:59:59 GMT";
- return true
- }
- });
- }
- function redirectToIndustrialCarrier() {
- $.ajax({
- url: pagePath + "/token/create",
- type: "get",
- dataType: "json",
- data: {
- timeStamp: new Date()
- },
- success: function (result) {
- console.log(result);
- if (result.success) {
- var token = result.obj;
- console.log(token);
- localStorage.setItem("INDUSTRIAL_CARRIER", token);
- }
- }
- });
- }
- </script>
- </body>
- </html>
- <style type="text/css">
- .red {
- color: #D0021B;
- padding: 0 5px;
- }
- .footer {
- position: fixed;
- bottom: 0;
- padding: 10px 0 0;
- }
- .form-group {
- padding-top: 30px;
- margin-bottom: 0;
- margin-left: 0;
- margin-right: 0;
- }
- .input-group {
- margin-top: 25px;
- }
- @media (min-width: 1200px) {
- .container {
- padding: 0 100px
- }
- }
- @media (min-width: 1600px) {
- .content {
- margin-top: 150px !important
- }
- }
- body {
- font-family: "华文细黑";
- /*width: 100%;*/
- /*height: 100%;*/
- /*background: url(".././home/image/background.png") no-repeat;*/
- /*background-size: 100%;*/
- /*background-position: bottom;*/
- }
- .layui-layer-padding {
- color: #333
- }
- /*.main{
- background: url(.././image/background.png) no-repeat 4px 5px;
- }*/
- </style>
|