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,13 +1,15 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
<title>NAS</title>
|
<title>NAS</title>
|
||||||
<link rel="stylesheet" href="/layui/css/layui.css">
|
<link rel="stylesheet" href="/layui/css/layui.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="layui-layout-body">
|
|
||||||
|
|
||||||
|
<body class5="layui-layout-body">
|
||||||
|
11
|
||||||
<script src="/layui/layui.js"></script>
|
<script src="/layui/layui.js"></script>
|
||||||
<script>
|
<script>
|
||||||
layui.use(['layer', 'form', 'element'], function () {
|
layui.use(['layer', 'form', 'element'], function () {
|
||||||
@ -18,4 +20,5 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -17,10 +17,24 @@
|
|||||||
<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="#">切换NAS页面</a></dd>
|
||||||
<dd><a href="#">B站直播管理</a></dd>
|
<dd><a href="#">B站直播管理</a></dd>
|
||||||
</dl>
|
</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">
|
||||||
@ -59,6 +73,7 @@
|
|||||||
#icon {
|
#icon {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.body {
|
.body {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user