24 lines
617 B
Java
24 lines
617 B
Java
|
package com.yutou.tools.web;
|
||
|
|
||
|
import com.alibaba.fastjson.JSONObject;
|
||
|
import com.yutou.tools.utils.Tools;
|
||
|
import org.springframework.stereotype.Controller;
|
||
|
|
||
|
import javax.servlet.http.Cookie;
|
||
|
import javax.servlet.http.HttpServletRequest;
|
||
|
|
||
|
@Controller
|
||
|
public class userController {
|
||
|
|
||
|
public String getLoginState(HttpServletRequest request){
|
||
|
JSONObject json=new JSONObject();
|
||
|
Cookie cookie= Tools.getCookie(request,"user");
|
||
|
if(cookie==null){
|
||
|
json.put("code",-1);
|
||
|
json.put("msg","未登录");
|
||
|
return json.toJSONString();
|
||
|
}
|
||
|
return "";
|
||
|
}
|
||
|
}
|