gcz há 1 ano atrás
pai
commit
6d09b8d8b0

BIN
forstlogin/img/login-logo-bg-icon.png


+ 134 - 4
forstlogin/index.html

@@ -3,7 +3,7 @@
 
 	<head>
 		<meta charset="UTF-8">
-		<title>贵州林产品溯源管理系统登录</title>
+		<title>蔬菜精准种植应用服务平台</title>
 		<meta name="renderer" content="webkit">
 		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
 		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
@@ -13,6 +13,78 @@
 		<link rel="stylesheet" type="text/css" href="../layui/css/layui.css" />
 		<link rel="stylesheet" type="text/css" href="css/style.css" />
 		<link rel="stylesheet" type="text/css" href="../iconfont/iconfont.css" />
+		<style type="text/css" >
+		    .loading{
+		        display: none;
+		        padding-top: 30vh;
+		        position: fixed;
+                left: 0;
+                top: 0;
+                width: 100vw;
+                height: 100vh;
+                z-index: 10001;
+                text-align: center;
+                background: rgba(0,0,0,.9);
+		    }
+		    .loading-text{
+		        color: #fff;
+		        font-size: 20px;
+		        margin-bottom: 25px;
+		        letter-spacing: 0.2em;
+		    }
+		    .loading span {
+              display: inline-block;
+              vertical-align: middle;
+              width: .6em;
+              height: .6em;
+              margin: .19em;
+              background: #007DB6;
+              border-radius: .6em;
+              animation: loading 1s infinite alternate;
+            }
+            
+            /*
+             * Dots Colors
+             * Smarter targeting vs nth-of-type?
+             */
+            .loading span:nth-of-type(2) {
+              background: #008FB2;
+              animation-delay: 0.2s;
+            }
+            .loading span:nth-of-type(3) {
+              background: #009B9E;
+              animation-delay: 0.4s;
+            }
+            .loading span:nth-of-type(4) {
+              background: #00A77D;
+              animation-delay: 0.6s;
+            }
+            .loading span:nth-of-type(5) {
+              background: #00B247;
+              animation-delay: 0.8s;
+            }
+            .loading span:nth-of-type(6) {
+              background: #5AB027;
+              animation-delay: 1.0s;
+            }
+            .loading span:nth-of-type(7) {
+              background: #A0B61E;
+              animation-delay: 1.2s;
+            }
+            
+            /*
+             * Animation keyframes
+             * Use transition opacity instead of keyframes?
+             */
+            @keyframes loading {
+              0% {
+                opacity: 0;
+              }
+              100% {
+                opacity: 1;
+              }
+            }
+		</style>
 	</head>
 
 	<body>
@@ -20,10 +92,11 @@
 			<div class="main-login">
 				<div class="login-box">
 					<div class="login-layout">
-						<div class="logo"></div>
+						<!-- <div class="logo"></div>-->
 						<form class="layui-form login-form" action="">
 							<h3 class="formTitle">
-								<img src="./img/login-logo-bg-icon.png">贵州林产品溯源管理系统</h3>
+							    <img src="./img/login-logo-bg-icon.png">蔬菜精准种植应用服务平台</h3>
+								
 							<div class="layui-form-item">
 								<i class="layui-icon">&#xe66f;</i>
 								<input type="text" name="account" required lay-verify="userName" placeholder="请输入账号" autocomplete="off" class="login-box-input layui-input">
@@ -38,6 +111,16 @@
 				</div>
 			</div>
 		</div>
+		<div id="loading" class="loading">
+          <div class="loading-text">登录中,请稍等</div>
+          <span></span>
+          <span></span>
+          <span></span>
+          <span></span>
+          <span></span>
+          <span></span>
+          <span></span>
+        </div>
 		<script src="../layui/layui.js" type="text/javascript" charset="utf-8"></script>
 		<script src="../js/ajaxhook.min.js" type="text/javascript" charset="utf-8"></script>
 		<script>
@@ -66,6 +149,52 @@
 						'密码必须6到12位,且不能出现空格'
 					]
 				});
+				
+				// 统一登录改造
+				// 获取URL参数
+				const urlParams = new URLSearchParams(window.location.search);
+				// 获取xxl_sso_sessionid的值
+				const sessionId = urlParams.get('xxl_sso_sessionid');
+				// console.log('sessionId', sessionId);
+				if (sessionId) {
+				    $('#loading').css('display','block');
+				    let data = {sessionId:sessionId}
+					$.ajax({
+					    url: 'ssoLogin',
+					    type: 'post',
+					    data: JSON.stringify(data),
+					    contentType: 'application/json',
+					    success: function (data) {
+					       // console.log('success data', data);
+					       var code = data.code,
+								user = { userId: ((((data.data || [])[0] || {}).CurrentUser || {}).guid || ""), name: ((((data.data || [])[0] || {}).CurrentUser || {}).account || ""), realName: ((((data.data || [])[0] || {}).CurrentUser || {}).userName || ""), menus: (((data.data || [])[0] || {}).authMenuObj || {}) },
+								token = ((data.data || [])[0] || {}).accessToken || null,
+								systemLable = { systemName: (((data.data || [])[0] || {}).orgObject || {}).systemName || "蔬菜精准种植应用服务平台" };
+								systemLable = { systemName:"蔬菜精准种植应用服务平台"}
+							if (!(code - 0)) {
+								//储存用户信息
+								layui.sessionData(window.hywa.sessionTable.tableName, {
+									key: window.hywa.sessionTable.userData,
+									value: user
+								});
+								//存储系统名称
+								layui.sessionData(window.hywa.sessionTable.tableName, {
+									key: 'sys',
+									value: systemLable
+								});
+								//存储token
+								layui.sessionData(window.hywa.sessionTable.tableName, {
+									key: 'token',
+									value: token
+								});
+								$('#loading').css('display','none');
+								//存储数组
+								location.href = window.hywa.jumpPage.home;
+							}
+					    }
+					})
+				}
+				// 统一登录改造
 
 				function ajaxLogin(data) {
 					var time = 'b8d11ee289394be688ef3a4f6968efed';
@@ -83,7 +212,8 @@
 							var code = data.code,
 								user = { userId: ((((data.data || [])[0] || {}).CurrentUser || {}).guid || ""), name: ((((data.data || [])[0] || {}).CurrentUser || {}).account || ""), realName: ((((data.data || [])[0] || {}).CurrentUser || {}).userName || ""), menus: (((data.data || [])[0] || {}).authMenuObj || {}) },
 								token = ((data.data || [])[0] || {}).accessToken || null,
-								systemLable = { systemName: (((data.data || [])[0] || {}).orgObject || {}).systemName || "贵州林产品溯源管理系统" };
+								systemLable = { systemName: (((data.data || [])[0] || {}).orgObject || {}).systemName || "蔬菜精准种植应用服务平台" };
+								systemLable = { systemName:"蔬菜精准种植应用服务平台"}
 							if (!(code - 0)) {
 								//储存用户信息
 								layui.sessionData(window.hywa.sessionTable.tableName, {

+ 1 - 1
forstpages/index.html

@@ -3,7 +3,7 @@
 
 <head>
 	<meta charset="utf-8">
-	<title>林产品溯源管理系统</title>
+	<title>蔬菜精准种植应用服务平台</title>
 	<meta name="renderer" content="webkit">
 	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
 	<meta http-equiv="Access-Control-Allow-Origin" content="*">

+ 1 - 1
forstpages/js/index.js

@@ -28,7 +28,7 @@ layui.config({
 			type: "GET",
 			url: 'loginOut',
 			success: function (res) {
-				debugger;
+				// debugger;
 				if (0 === res.code) {
 					layui.sessionData(window.hywa.sessionTable.tableName, null);
 					window.sessionStorage.removeItem("menu");

+ 11 - 2
index.html

@@ -4,12 +4,21 @@
 <head>
 	<meta charset="utf-8" />
 	<meta name="viewport" content="width=device-width, initial-scale=1">
-	<title>林产品溯源管理系统</title>
+	<title>蔬菜精准种植应用服务平台</title>
 </head>
 
 <body>
 	<script type="text/javascript">
-		window.location.href = "forstlogin/index.html?ver=" + new Date().getTime();
+	    const urlParams = new URLSearchParams(window.location.search);
+		// 获取xxl_sso_sessionid的值
+		const sessionId = urlParams.get('xxl_sso_sessionid');
+// 		console.log('sessionId', sessionId);
+		if (sessionId) {
+		    window.location.href = "forstlogin/index.html?ver=" + new Date().getTime() + '&xxl_sso_sessionid=' +sessionId;
+		}else{
+		    window.location.href = "forstlogin/index.html?ver=" + new Date().getTime();
+		}
+		
 	</script>
 </body>
 

+ 1 - 0
js/config.js

@@ -32,6 +32,7 @@ function loadJS(url) {
 				login: '/web/user/login', //登录
 				loginOut: "/web/user/logout", //退出
 				changePassword: "/web/user/edit", //修改密码
+				ssoLogin: "/web/user/ssoLogin", //统一登录
 
 				userList: "/web/user/searchByPage", //列表
 				add_user: "/web/user/add", //添加