update
This commit is contained in:
parent
b1ded445bf
commit
a05953ec75
15
src/main/java/com/yutou/tools/utils/Tools.java
Normal file
15
src/main/java/com/yutou/tools/utils/Tools.java
Normal 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;
|
||||
}
|
||||
}
|
23
src/main/java/com/yutou/tools/web/userController.java
Normal file
23
src/main/java/com/yutou/tools/web/userController.java
Normal 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 "";
|
||||
}
|
||||
}
|
@ -1,21 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>NAS</title>
|
||||
<link rel="stylesheet" href="/layui/css/layui.css">
|
||||
</head>
|
||||
<body class="layui-layout-body">
|
||||
|
||||
<script src="/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.use(['layer', 'form', 'element'], function () {
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>NAS</title>
|
||||
<link rel="stylesheet" href="/layui/css/layui.css">
|
||||
</head>
|
||||
|
||||
<body class5="layui-layout-body">
|
||||
11
|
||||
<script src="/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.use(['layer', 'form', 'element'], function () {
|
||||
var layer = layui.layer
|
||||
, form = layui.form;
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -15,12 +15,26 @@
|
||||
<li class="layui-nav-item"><a href="http://blog.yutou233.cn">博客</a></li>
|
||||
<div id="admin" style="display: inline-block; font-size: 0px;">
|
||||
<li class="layui-nav-item"><a href="javascript:;">NAS管理</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="#">查看NAS IP</a></dd>
|
||||
<dd><a href="#">B站直播管理</a></dd>
|
||||
</dl>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="#">查看NAS IP</a></dd>
|
||||
<dd><a href="#">切换NAS页面</a></dd>
|
||||
<dd><a href="#">B站直播管理</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
</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'>
|
||||
<a href=""><img src="//t.cn/RCzsdCq" class="layui-nav-img">登录</a>
|
||||
<dl class="layui-nav-child">
|
||||
@ -31,18 +45,18 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="layui-body" style="left: 0px;">
|
||||
<iframe src="../html/body/nas.html" width="100%" height="99%" frameborder="no" ></iframe>
|
||||
|
||||
<div class="layui-body" style="left: 0px;">
|
||||
<iframe src="../html/body/nas.html" width="100%" height="99%" frameborder="no"></iframe>
|
||||
</div>
|
||||
<div class="layui-footer" style="left: 0px; text-align: center; height: 60px; line-height: 0;" >
|
||||
<div style="line-height: 44px;">
|
||||
<div class="layui-footer" style="left: 0px; text-align: center; height: 60px; line-height: 0;">
|
||||
<div style="line-height: 44px;">
|
||||
©2020 by yutou
|
||||
</div>
|
||||
<div>
|
||||
<a href="#">湘ICP备16005656号</a>
|
||||
<a href="#">湘ICP备16005656号</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -59,7 +73,8 @@
|
||||
#icon {
|
||||
float: right;
|
||||
}
|
||||
.body{
|
||||
|
||||
.body {
|
||||
bottom: 0;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user