package com.cmsz.itbrs.infoserver.controller;import java.util.HashMap;import java.util.Map;import javax.servlet.http.HttpSession;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.web.bind.annotation.RequestBody;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestMethod;import org.springframework.web.bind.annotation.RestController;import com.cmsz.itbrs.infoserver.service.LoginService;import com.cmsz.vo.UserInfoVo;@RestControllerpublic class LoginController {@AutowiredLoginService loginservice; @RequestMapping(value="denglu",method=RequestMethod.POST) public Map<String, Object> Login(@RequestBody UserInfoVo user, HttpSession session){ Map<String,Object> result=new HashMap<String, Object>(); UserInfoVo userinfovo=loginservice.dl(user); if(userinfovo!=null){ session.setAttribute("yhm", userinfovo.getLoginUser()); session.setMaxInactiveInterval(30); result.put("result", "success"); }else{ result.put("result", "shibai"); } return result; } }
添加回答
举报
0/150
提交
取消