|
|
|
@ -0,0 +1,373 @@
|
|
|
|
|
package top.ezzd.controller;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.Cookie;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import top.ezzd.pojo.Apply;
|
|
|
|
|
import top.ezzd.pojo.Ip;
|
|
|
|
|
import top.ezzd.pojo.Photo;
|
|
|
|
|
import top.ezzd.pojo.User;
|
|
|
|
|
import top.ezzd.service.ApplyService;
|
|
|
|
|
import top.ezzd.service.BanIpService;
|
|
|
|
|
import top.ezzd.service.IpService;
|
|
|
|
|
import top.ezzd.service.UserPhotoService;
|
|
|
|
|
import top.ezzd.service.UserService;
|
|
|
|
|
import top.ezzd.tools.GetIp;
|
|
|
|
|
import top.ezzd.tools.PhotoFileUtils;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD>˻<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* @author SmallHappy
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
@Controller
|
|
|
|
|
public class UserController {
|
|
|
|
|
@Resource
|
|
|
|
|
private UserService userServiceImpl;
|
|
|
|
|
@Resource
|
|
|
|
|
private UserPhotoService userPhotoServiceImpl;
|
|
|
|
|
@Resource
|
|
|
|
|
private ApplyService applyServiceImpl;
|
|
|
|
|
@Resource
|
|
|
|
|
private IpService ipServiceImpl;
|
|
|
|
|
@Resource
|
|
|
|
|
BanIpService banIpServiceImpl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private GetIp getIp =new GetIp();
|
|
|
|
|
|
|
|
|
|
private Ip ip = new Ip();
|
|
|
|
|
// @Resource
|
|
|
|
|
// private UserForgetService userForgetServiceImpl;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD>¼
|
|
|
|
|
*
|
|
|
|
|
* @param u
|
|
|
|
|
* @param session
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value={"/login"},method={RequestMethod.POST})
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String userLogin(User u, HttpSession session, HttpServletRequest req, HttpServletResponse resp) {
|
|
|
|
|
try {
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>user<65><72>Ϣ<EFBFBD><CFA2><EFBFBD>ݵ<EFBFBD>service<63><65><EFBFBD>ѯ
|
|
|
|
|
User user = userServiceImpl.selectUser(u);
|
|
|
|
|
// <20><><EFBFBD>user<65><72>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>¼<EFBFBD>ɹ<EFBFBD>
|
|
|
|
|
if (user != null) {
|
|
|
|
|
// <20><>ȡǰ<C8A1><C7B0>ҳ<EFBFBD>湴ѡ<E6B9B4><D1A1><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
String remember = req.getParameter("remember");
|
|
|
|
|
// <20><>user<65><72>Ϣд<CFA2><D0B4>session<6F><6E>
|
|
|
|
|
session.setAttribute("user", user);
|
|
|
|
|
// <20><>applyд<79><D0B4>session<6F><6E>
|
|
|
|
|
Apply apply = applyServiceImpl.selectApplyByUname(user.getUname());
|
|
|
|
|
session.setAttribute("apply", apply);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0>ҳ<EFBFBD>浥ѡ<E6B5A5><D1A1><EFBFBD><EFBFBD><EFBFBD>ϢΪtrue
|
|
|
|
|
if (remember.equals("true")) {
|
|
|
|
|
// ʹ<><CAB9>cookie
|
|
|
|
|
Cookie cookie = new Cookie("USERJSESSIONID", user.getCookieuuid());
|
|
|
|
|
// <20><>ֹʹ<D6B9><CAB9>cookie<69>ƹ<EFBFBD><C6B9><EFBFBD>¼
|
|
|
|
|
cookie.setHttpOnly(true);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>cookie<69><65><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
cookie.setMaxAge(3600 * 24 * 30);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>cookie<69><65>·<EFBFBD><C2B7>
|
|
|
|
|
cookie.setPath(req.getContextPath()+"/");
|
|
|
|
|
// <20><>cookieд<65><D0B4><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>
|
|
|
|
|
resp.addCookie(cookie);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return "1";
|
|
|
|
|
} else {
|
|
|
|
|
return "2";
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return "3";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>û<EFBFBD>ע<EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* @param u
|
|
|
|
|
* @param req
|
|
|
|
|
* @param session
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("insertUser")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String insertUser(User u, HttpServletRequest req, HttpSession session) {
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>UUID <20><><EFBFBD><EFBFBD>CookieUUID
|
|
|
|
|
String cookieuuid = UUID.randomUUID().toString();
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD>UUID<49><44><EFBFBD><EFBFBD>User<65><72>
|
|
|
|
|
u.setCookieuuid(cookieuuid);
|
|
|
|
|
// <20><>ȡ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>
|
|
|
|
|
String uyzm = req.getParameter("uyzm");
|
|
|
|
|
// String root = req.getParameter("root");
|
|
|
|
|
// if (root.equals("SMDH")) {
|
|
|
|
|
// return "4";
|
|
|
|
|
// } else {
|
|
|
|
|
// <20><>ȡsession<6F>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>
|
|
|
|
|
String yzm = (String) session.getAttribute("registCode");
|
|
|
|
|
// <20>ж<EFBFBD><D0B6><EFBFBD>֤<EFBFBD><D6A4><EFBFBD>Ƿ<EFBFBD>һ<EFBFBD><D2BB>
|
|
|
|
|
|
|
|
|
|
if (yzm==null||!yzm.equals(uyzm)) {
|
|
|
|
|
return "0";
|
|
|
|
|
}
|
|
|
|
|
// <20><>֤<EFBFBD><D6A4>ʹ<EFBFBD>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>ʹ<EFBFBD><CAB9>
|
|
|
|
|
session.removeAttribute("registCode");
|
|
|
|
|
try {
|
|
|
|
|
// <20><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD>û<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
|
|
|
|
|
int index = userServiceImpl.insertUser(u);
|
|
|
|
|
if (index == 1) {
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>uname<6D><65><EFBFBD><EFBFBD>session<6F><6E>
|
|
|
|
|
session.setAttribute("uname", u.getUname());
|
|
|
|
|
return "1";
|
|
|
|
|
} else {
|
|
|
|
|
return "2";
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return "3";
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* @param req
|
|
|
|
|
* @param session
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("updateUser")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String updateUser(HttpServletRequest req, HttpSession session) {
|
|
|
|
|
// <20><>ȡ<EFBFBD>û<EFBFBD><C3BB><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
String nickname = req.getParameter("nickname");
|
|
|
|
|
String uname = req.getParameter("uname");
|
|
|
|
|
String newpwd = req.getParameter("newpwd");
|
|
|
|
|
String oldpwd = req.getParameter("oldpwd");
|
|
|
|
|
String uyzm = req.getParameter("uyzm");
|
|
|
|
|
// <20><>ȡsession<6F><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>
|
|
|
|
|
String yzm = (String) session.getAttribute("updateCode");
|
|
|
|
|
|
|
|
|
|
// <20>ж<EFBFBD><D0B6><EFBFBD>֤<EFBFBD><D6A4><EFBFBD>Ƿ<EFBFBD>һ<EFBFBD><D2BB>
|
|
|
|
|
if (yzm == null || !yzm.equals(uyzm)) {
|
|
|
|
|
return "0";
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
|
// <20><>֤<EFBFBD><D6A4>ʹ<EFBFBD>ú<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>ʹ<EFBFBD><CAB9>
|
|
|
|
|
session.removeAttribute("updateCode");
|
|
|
|
|
// <20><>ȡҵ<C8A1><D2B5><EFBFBD> <20><><EFBFBD>û<EFBFBD><C3BB><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
|
|
|
|
int index = userServiceImpl.updateUser(nickname, uname, newpwd, oldpwd);
|
|
|
|
|
|
|
|
|
|
if (index == 1) {
|
|
|
|
|
// <20>ж<EFBFBD><D0B6>û<EFBFBD><C3BB>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA>¼״̬<D7B4><CCAC><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>¼״̬<D7B4><CCAC><EFBFBD>Ƴ<EFBFBD><C6B3><EFBFBD>¼״̬
|
|
|
|
|
if (session.getAttribute("user") != null) {
|
|
|
|
|
session.removeAttribute("user");
|
|
|
|
|
}
|
|
|
|
|
return "1";
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
return "2";
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return "3";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ɾ<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* @param u
|
|
|
|
|
* @param req
|
|
|
|
|
* @param session
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("deleteUser")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String deleteUser(User u, HttpServletRequest req, HttpSession session) {
|
|
|
|
|
// <20><>ȡ<EFBFBD>û<EFBFBD><C3BB><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>
|
|
|
|
|
String uyzm = req.getParameter("uyzm");
|
|
|
|
|
// <20><>ȡsession<6F>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>
|
|
|
|
|
String yzm = (String) session.getAttribute("deleteCode");
|
|
|
|
|
// <20>ж<EFBFBD><D0B6><EFBFBD>֤<EFBFBD><D6A4><EFBFBD>Ƿ<EFBFBD>һ<EFBFBD><D2BB>
|
|
|
|
|
if (yzm==null||!yzm.equals(uyzm)) {
|
|
|
|
|
|
|
|
|
|
return "0";
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
|
// <20><>֤<EFBFBD><D6A4>ʹ<EFBFBD>ú<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>ʹ<EFBFBD><CAB9>
|
|
|
|
|
session.removeAttribute("deleteCode");
|
|
|
|
|
// <20>ж<EFBFBD><D0B6>û<EFBFBD><C3BB>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>
|
|
|
|
|
User user = userServiceImpl.selectUser(u);
|
|
|
|
|
if (user != null) {
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>㣬<EFBFBD><E3A3AC><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD>list<73><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
List<Photo> photo = userPhotoServiceImpl.selectPhotoById(user.getUid());
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>
|
|
|
|
|
for (Photo photo2 : photo) {
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>
|
|
|
|
|
String path = "/usr/local/tomcat/webapps/ROOT/UpPhoto/" + photo2.getAddress();
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|
|
|
|
File file = new File(path);
|
|
|
|
|
// ɾ<><C9BE>
|
|
|
|
|
PhotoFileUtils.deleteFile(file);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return "2";
|
|
|
|
|
}
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ɾ<EFBFBD><C9BE>ҵ<EFBFBD><D2B5><EFBFBD>
|
|
|
|
|
int index = userServiceImpl.deleteUser(u);
|
|
|
|
|
if (index == 1) {
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>㣬<EFBFBD><E3A3AC><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>IDɾ<44><C9BE><EFBFBD><EFBFBD>Ƭ
|
|
|
|
|
userPhotoServiceImpl.deletePhotoByUid(user.getUid());
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>session(ʹ<><CAB9>ǰ<EFBFBD>ỰsessionʧЧ)
|
|
|
|
|
session.invalidate();
|
|
|
|
|
return "1";
|
|
|
|
|
} else {
|
|
|
|
|
return "2";
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return "3";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>û<EFBFBD><EFBFBD>dz<EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* @param session
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("logout")
|
|
|
|
|
public String userLogOut(HttpSession session, HttpServletRequest req, HttpServletResponse resp) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>session(ʹ<><CAB9>ǰ<EFBFBD>ỰsessionʧЧ)
|
|
|
|
|
session.invalidate();
|
|
|
|
|
|
|
|
|
|
// <20><>ȡǰ̨cookie<69><65><EFBFBD><EFBFBD>
|
|
|
|
|
if (req.getCookies() != null) {
|
|
|
|
|
// <20><>cookie<69><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
|
|
|
|
|
Cookie cookie = new Cookie("USERJSESSIONID", null);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ 0
|
|
|
|
|
cookie.setMaxAge(0);
|
|
|
|
|
cookie.setPath("/");
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>cookie
|
|
|
|
|
resp.addCookie(cookie);
|
|
|
|
|
}
|
|
|
|
|
String loginUrl = resp.encodeRedirectURL("/dispatcher?page=login");
|
|
|
|
|
return "redirect:"+loginUrl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><EFBFBD>)
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param req
|
|
|
|
|
* @param session
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("userSuggest")
|
|
|
|
|
public String userSuggest(HttpServletRequest req, HttpSession session,HttpServletResponse resp) {
|
|
|
|
|
session.getAttribute("user");
|
|
|
|
|
// System.out.println(
|
|
|
|
|
// u.getNickname() + "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n<><6E><EFBFBD><EFBFBD>Ϊ:" + req.getParameter("title") + "\n<><6E><EFBFBD><EFBFBD>Ϊ:"
|
|
|
|
|
// + req.getParameter("message"));
|
|
|
|
|
String indexUrl = resp.encodeURL("/dispatcher?page=index");
|
|
|
|
|
return indexUrl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Cookie<EFBFBD><EFBFBD>¼
|
|
|
|
|
*
|
|
|
|
|
* @param req <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
* @param session
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("cookieLogin")
|
|
|
|
|
public String cookieLogin(HttpServletRequest req, HttpSession session, HttpServletResponse resp) {
|
|
|
|
|
// ip<69><70>ַ<EFBFBD><D6B7>ȡ
|
|
|
|
|
String ipAddress = req.getRemoteAddr();
|
|
|
|
|
if(banIpServiceImpl.selectBanIpByIp(ipAddress)!=null){
|
|
|
|
|
String Url_503 = resp.encodeRedirectURL("/dispatcher?page=503");
|
|
|
|
|
return "redirect:"+Url_503;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
String region = getIp.IpRegion(ipAddress);
|
|
|
|
|
|
|
|
|
|
ip.setIpaddress(ipAddress);
|
|
|
|
|
ip.setRegion(region);
|
|
|
|
|
ipServiceImpl.insertIp(ip);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
String indexUrl = resp.encodeRedirectURL("/dispatcher?page=index");
|
|
|
|
|
if (session.getAttribute("user") == null) {
|
|
|
|
|
Cookie[] cookies = req.getCookies();
|
|
|
|
|
if (cookies != null) {
|
|
|
|
|
for (Cookie c : cookies) {
|
|
|
|
|
if (c.getName().equalsIgnoreCase("USERJSESSIONID")) {
|
|
|
|
|
if (c.getValue() != null) {
|
|
|
|
|
String cookieuuid = c.getValue();
|
|
|
|
|
User user = userServiceImpl.selectUserByUuid(cookieuuid);
|
|
|
|
|
if (user != null) {
|
|
|
|
|
// <20><>applyд<79><D0B4>session<6F><6E>
|
|
|
|
|
Apply apply = applyServiceImpl.selectApplyByUname(user.getUname());
|
|
|
|
|
session.setAttribute("apply", apply);
|
|
|
|
|
// <20><>userд<72><D0B4>session
|
|
|
|
|
session.setAttribute("user", user);
|
|
|
|
|
return "redirect:"+indexUrl;
|
|
|
|
|
} else {
|
|
|
|
|
return "redirect:"+indexUrl;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return "redirect:"+indexUrl;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return "redirect:"+indexUrl;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return "redirect:"+indexUrl;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return "redirect:"+indexUrl;
|
|
|
|
|
}
|
|
|
|
|
return "redirect:"+indexUrl;
|
|
|
|
|
}
|
|
|
|
|
}
|