forked from AwakenCN/InChat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hacker
committed
Sep 5, 2018
1 parent
ff7a241
commit fe07c2f
Showing
21 changed files
with
738 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>酥酥</title> | ||
<meta name="viewport" content="initial-scale=1, maximum-scale=1"> | ||
<link rel="shortcut icon" href="/susu/image/logoSmall.png"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
|
||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css"> | ||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css"> | ||
|
||
</head> | ||
<body> | ||
<div class="page"> | ||
<header class="bar bar-nav"> | ||
<h1 class="title">酥酥</h1> | ||
</header> | ||
<nav class="bar bar-tab"> | ||
<a class="tab-item active" href="#"> | ||
<span class="icon icon-message"></span> | ||
<span class="tab-label">信息</span> | ||
</a> | ||
<a class="tab-item" href="#"> | ||
<span class="icon icon-friends"></span> | ||
<span class="tab-label">通讯录</span> | ||
</a> | ||
<a class="tab-item" href="#"> | ||
<span class="icon icon-browser"></span> | ||
<span class="tab-label">发现</span> | ||
</a> | ||
<a class="tab-item" href="#"> | ||
<span class="icon icon-me"></span> | ||
<span class="tab-label">我</span> | ||
</a> | ||
</nav> | ||
<div class="content"> | ||
|
||
</div> | ||
</div> | ||
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script> | ||
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script> | ||
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>酥酥</title> | ||
<meta name="viewport" content="initial-scale=1, maximum-scale=1"> | ||
<!--<link rel="shortcut icon" href="/favicon.ico">--> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
|
||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css"> | ||
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css"> | ||
|
||
</head> | ||
<body> | ||
<div class="page-group"> | ||
<div class="page page-current"> | ||
<!-- 你的html代码 --> | ||
<header class="bar bar-nav"> | ||
<h1 class="title">登录</h1> | ||
</header> | ||
<div class="content"> | ||
<div class="list-block"> | ||
<ul> | ||
<!-- Text inputs --> | ||
<li> | ||
<div class="item-content"> | ||
<div class="item-media"><i class="icon icon-form-name"></i></div> | ||
<div class="item-inner"> | ||
<div class="item-title label">账号</div> | ||
<div class="item-input"> | ||
<input type="text" placeholder="Your name"> | ||
</div> | ||
</div> | ||
</div> | ||
</li> | ||
<li> | ||
<div class="item-content"> | ||
<div class="item-media"><i class="icon icon-form-password"></i></div> | ||
<div class="item-inner"> | ||
<div class="item-title label">密码</div> | ||
<div class="item-input"> | ||
<input type="password" placeholder="Password" class=""> | ||
</div> | ||
</div> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="content-block"> | ||
<div class="row"> | ||
<div class="col-50"><a href="#" class="button button-big button-fill button-danger">登录</a></div> | ||
<div class="col-50"><a href="#" class="button button-big button-fill button-success">注册</a></div> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- 你的html代码 --> | ||
</div> | ||
</div> | ||
|
||
<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script> | ||
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script> | ||
<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script> | ||
|
||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
src/main/java/com/myself/nettychat/controller/NcChangeController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package com.myself.nettychat.controller; | ||
|
||
import com.myself.nettychat.constont.CookieConstant; | ||
import com.myself.nettychat.constont.H5Constant; | ||
import com.myself.nettychat.dataobject.User; | ||
import com.myself.nettychat.service.UserService; | ||
import com.myself.nettychat.store.TokenStore; | ||
import com.myself.nettychat.utils.CookieUtil; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.context.request.RequestContextHolder; | ||
import org.springframework.web.context.request.ServletRequestAttributes; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
import javax.servlet.http.Cookie; | ||
import javax.servlet.http.HttpServletRequest; | ||
import java.util.Map; | ||
|
||
/** | ||
* @Author:UncleCatMySelf | ||
* @Email:[email protected] | ||
* @QQ:1341933031 | ||
* @Date:Created in 15:59 2018\9\5 0005 | ||
*/ | ||
@Controller | ||
@RequestMapping("/su") | ||
public class NcChangeController { | ||
|
||
@Autowired | ||
private UserService userService; | ||
|
||
/** | ||
* 我的中心界面 | ||
* @param map | ||
* @return | ||
*/ | ||
@GetMapping("/me") | ||
public ModelAndView Me(Map<String,Object> map){ | ||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); | ||
HttpServletRequest request = attributes.getRequest(); | ||
Cookie cookie = CookieUtil.get(request, CookieConstant.TOKEN); | ||
if (cookie == null){ | ||
map.put("msg","cookie中不存在token"); | ||
return new ModelAndView(H5Constant.LOGIN_SUI,map); | ||
} | ||
Integer userId = (Integer) TokenStore.get(cookie.getValue()); | ||
if (userId == null){ | ||
map.put("msg","用户信息不存在"); | ||
return new ModelAndView(H5Constant.LOGIN_SUI,map); | ||
} | ||
User user = userService.findOne(userId); | ||
map.put("userName",user.getUserName()); | ||
return new ModelAndView(H5Constant.ME,map); | ||
} | ||
|
||
/** | ||
* 发现 | ||
* @param map | ||
* @return | ||
*/ | ||
@GetMapping("/find") | ||
public ModelAndView find(Map<String,Object> map){ | ||
return new ModelAndView(H5Constant.FIND); | ||
} | ||
|
||
/** | ||
* 聊天 | ||
* @param map | ||
* @return | ||
*/ | ||
@GetMapping("/chat") | ||
public ModelAndView chat(Map<String,Object> map){ | ||
return new ModelAndView(H5Constant.CHAT); | ||
} | ||
|
||
/** | ||
* 主页 | ||
* @param map | ||
* @return | ||
*/ | ||
@GetMapping("/home") | ||
public ModelAndView home(Map<String,Object> map){ | ||
return new ModelAndView(H5Constant.HOME); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.