package xyz.wbsite.dbtool.web.action.ajax.system;

import xyz.wbsite.dbtool.web.frame.auth.LocalData;
import xyz.wbsite.dbtool.web.frame.base.BaseResponse;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class AuthAjax {

    public BaseResponse login(String jsonParam) {
        BaseResponse baseResponse = new BaseResponse();

        // todo 设置cookie
        HttpServletRequest request = LocalData.getRequest();
        HttpServletResponse response = LocalData.getResponse();
        Cookie token = new Cookie("token", "");
        token.setDomain(request.getServerName());
        token.setPath("/");
        response.addCookie(token);

        return baseResponse;
    }
}
