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;
@RestController
public class LoginController {
@Autowired
LoginService 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;
}
}
慕瓜9220888
落叶1111
李晓健