This commit is contained in:
Yutousama 2020-04-16 01:53:25 +08:00
parent b1ded445bf
commit a05953ec75
4 changed files with 82 additions and 26 deletions

View File

@ -0,0 +1,15 @@
package com.yutou.tools.utils;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
public class Tools {
public static Cookie getCookie(HttpServletRequest request,String key){
for (Cookie cookie : request.getCookies()) {
if(cookie.getName().equals(key)){
return cookie;
}
}
return null;
}
}

View File

@ -0,0 +1,23 @@
package com.yutou.tools.web;
import com.alibaba.fastjson.JSONObject;
import com.yutou.tools.utils.Tools;
import org.springframework.stereotype.Controller;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@Controller
public class userController {
public String getLoginState(HttpServletRequest request){
JSONObject json=new JSONObject();
Cookie cookie= Tools.getCookie(request,"user");
if(cookie==null){
json.put("code",-1);
json.put("msg","未登录");
return json.toJSONString();
}
return "";
}
}

View File

@ -1,21 +1,24 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<meta charset="utf-8"> <head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta charset="utf-8">
<title>NAS</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/layui/css/layui.css"> <title>NAS</title>
</head> <link rel="stylesheet" href="/layui/css/layui.css">
<body class="layui-layout-body"> </head>
<script src="/layui/layui.js"></script> <body class5="layui-layout-body">
<script> 11
layui.use(['layer', 'form', 'element'], function () { <script src="/layui/layui.js"></script>
<script>
layui.use(['layer', 'form', 'element'], function () {
var layer = layui.layer var layer = layui.layer
, form = layui.form; , form = layui.form;
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -15,12 +15,26 @@
<li class="layui-nav-item"><a href="http://blog.yutou233.cn">博客</a></li> <li class="layui-nav-item"><a href="http://blog.yutou233.cn">博客</a></li>
<div id="admin" style="display: inline-block; font-size: 0px;"> <div id="admin" style="display: inline-block; font-size: 0px;">
<li class="layui-nav-item"><a href="javascript:;">NAS管理</a> <li class="layui-nav-item"><a href="javascript:;">NAS管理</a>
<dl class="layui-nav-child"> <dl class="layui-nav-child">
<dd><a href="#">查看NAS IP</a></dd> <dd><a href="#">查看NAS IP</a></dd>
<dd><a href="#">B站直播管理</a></dd> <dd><a href="#">切换NAS页面</a></dd>
</dl> <dd><a href="#">B站直播管理</a></dd>
</dl>
</li> </li>
</div> </div>
<li class="layui-nav-item">
<a href="javascript:;">工具集</a>
<dl class="layui-nav-child">
<dd><a href="javascript:;" target="_blank">密码管理器</a></dd>
</dl>
</li>
<li class="layui-nav-item">
<a href="javascript:;">页面集</a>
<dl class="layui-nav-child">
<dd><a href="http://nas.yutou233.cn/" target="_blank">管理后台</a></dd>
<dd><a href="http://bt.yutou233.cn" target="_blank">BT下载</a></dd>
</dl>
</li>
<li class="layui-nav-item" id='icon'> <li class="layui-nav-item" id='icon'>
<a href=""><img src="//t.cn/RCzsdCq" class="layui-nav-img">登录</a> <a href=""><img src="//t.cn/RCzsdCq" class="layui-nav-img">登录</a>
<dl class="layui-nav-child"> <dl class="layui-nav-child">
@ -31,18 +45,18 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="layui-body" style="left: 0px;"> <div class="layui-body" style="left: 0px;">
<iframe src="../html/body/nas.html" width="100%" height="99%" frameborder="no" ></iframe> <iframe src="../html/body/nas.html" width="100%" height="99%" frameborder="no"></iframe>
</div> </div>
<div class="layui-footer" style="left: 0px; text-align: center; height: 60px; line-height: 0;" > <div class="layui-footer" style="left: 0px; text-align: center; height: 60px; line-height: 0;">
<div style="line-height: 44px;"> <div style="line-height: 44px;">
©2020 by yutou ©2020 by yutou
</div> </div>
<div> <div>
<a href="#">湘ICP备16005656号</a> <a href="#">湘ICP备16005656号</a>
</div> </div>
</div> </div>
</div> </div>
@ -59,7 +73,8 @@
#icon { #icon {
float: right; float: right;
} }
.body{
.body {
bottom: 0; bottom: 0;
} }
</style> </style>