Commit 101b89cf authored by 赵啸非's avatar 赵啸非

修改文档与添加登录返回token和过期时间

parent 44cd6848
......@@ -19,6 +19,7 @@ import com.mortals.xhx.common.key.RedisKey;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -106,8 +107,11 @@ public class LoginController extends BaseCRUDJsonController<UserService, UserFor
//设置token 和过期时间
CookieInfo loginCookie = CookieService.getLoginCookie(request);
data.put("token", loginCookie.getToken());
data.put("expiresTime",loginCookie.getExpiresTime().getTime());
if(!ObjectUtils.isEmpty(loginCookie)){
data.put("token", loginCookie.getToken());
data.put("expiresTime",loginCookie.getExpiresTime().getTime());
}
// this.generateBlackCookie(request, response, loginName, urls);
ret.put(KEY_RESULT_DATA, data);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment