|
@ -3,12 +3,14 @@ package com.yihu.wlyy.controller.common.account;
|
|
|
import com.yihu.wlyy.controller.BaseController;
|
|
|
import com.yihu.wlyy.entity.Patient;
|
|
|
import com.yihu.wlyy.entity.User;
|
|
|
import com.yihu.wlyy.entity.WlyyCustomerLog;
|
|
|
import com.yihu.wlyy.repository.ManageDictDao;
|
|
|
import com.yihu.wlyy.service.manager.account.CustomerService;
|
|
|
import com.yihu.wlyy.service.manager.family.FamilyMemberService;
|
|
|
import com.yihu.wlyy.service.manager.patient.AdminPatientService;
|
|
|
import com.yihu.wlyy.service.manager.sign.SignFamilyService;
|
|
|
import com.yihu.wlyy.service.manager.user.UserService;
|
|
|
import com.yihu.wlyy.service.manager.user.WlyyCustomerLogService;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -16,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.Date;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@ -41,6 +44,9 @@ public class CustomerController extends BaseController {
|
|
|
@Autowired
|
|
|
private SignFamilyService signFamilyService;
|
|
|
|
|
|
@Autowired
|
|
|
private WlyyCustomerLogService wlyyCustomerLogService;
|
|
|
|
|
|
@RequestMapping(value = "/login",produces="application/json;charset=UTF-8")
|
|
|
@ResponseBody
|
|
|
public String login(@ApiParam(name = "userName", value = "账号", required = true)@RequestParam(required = true, name = "userName") String userName,
|
|
@ -63,6 +69,11 @@ public class CustomerController extends BaseController {
|
|
|
req.getSession().setAttribute("name",curUser.getName());
|
|
|
req.getSession().setAttribute("isLogin", "true");
|
|
|
req.getSession().setMaxInactiveInterval(-1);//设置session用不过期
|
|
|
WlyyCustomerLog wlyyCustomerLog = new WlyyCustomerLog();
|
|
|
wlyyCustomerLog.setCreateTime(new Date());
|
|
|
wlyyCustomerLog.setUser(curUser.getCode());
|
|
|
wlyyCustomerLog.setType(1);
|
|
|
wlyyCustomerLogService.save(wlyyCustomerLog);
|
|
|
return write(1,"登入成功","user",curUser);
|
|
|
}
|
|
|
}
|
|
@ -75,6 +86,11 @@ public class CustomerController extends BaseController {
|
|
|
req.getSession().removeAttribute("code");
|
|
|
req.getSession().removeAttribute("name");
|
|
|
req.getSession().removeAttribute("isLogin");
|
|
|
WlyyCustomerLog wlyyCustomerLog = new WlyyCustomerLog();
|
|
|
wlyyCustomerLog.setCreateTime(new Date());
|
|
|
wlyyCustomerLog.setUser((String) req.getSession().getAttribute("code"));
|
|
|
wlyyCustomerLog.setType(0);
|
|
|
wlyyCustomerLogService.save(wlyyCustomerLog);
|
|
|
return write(1,"退出成功");
|
|
|
}
|
|
|
|