spring+springmvc+Interceptor+jwt+redis實(shí)現(xiàn)sso單點(diǎn)登錄

在分布式環(huán)境中,如何支持PC朽缎、APP(ios惨远、android)等多端的會(huì)話共享,這也是所有公司都需要的解決方案话肖,用傳統(tǒng)的session方式來(lái)解決北秽,我想已經(jīng)out了,我們是否可以找一個(gè)通用的方案狼牺,比如用傳統(tǒng)cas來(lái)實(shí)現(xiàn)多系統(tǒng)之間的sso單點(diǎn)登錄或使用oauth的第三方登錄方案? 今天給大家簡(jiǎn)單講解一下使用spring攔截器Interceptor機(jī)制羡儿、jwt認(rèn)證方式、redis分布式緩存實(shí)現(xiàn)sso單點(diǎn)登錄

}

publicvoid?setUid(String?uid)?{

this.uid?=?uid;

}

public?String?getToken()?{

return?token;

}

publicvoid?setToken(String?token)?{

this.token?=?token;

}

publiclong?getRefTime()?{

return?refTime;

}

publicvoid?setRefTime(long?refTime)?{

this.refTime?=?refTime;

}

}

public class RedisLogin implements Serializable{

/**

*

*/

private static final long serialVersionUID = 8116817810829835862L;

/**

* 用戶id

*/

private String uid;

/**

* jwt生成的token信息

*/

private String token;

/**

* 登錄或刷新應(yīng)用的時(shí)間

*/

private long refTime;

public RedisLogin(){

}

public RedisLogin(String uid, String token, long refTime){

this.uid = uid;

this.token = token;

this.refTime = refTime;

}

public String getUid() {

return uid;

}

public void setUid(String uid) {

this.uid = uid;

}

public String getToken() {

return token;

}

public void setToken(String token) {

this.token = token;

}

public long getRefTime() {

return refTime;

}

public void setRefTime(long refTime) {

this.refTime = refTime;

}

}

6. 編寫(xiě)LoginInterceptor.java攔截器

Java代碼

publicclass?LoginInterceptorimplements?HandlerInterceptor{

publicboolean?preHandle(HttpServletRequest?request,?HttpServletResponse?response,?Object?handler)

throws?Exception?{

PrintWriter?writer?=null;

HandlerMethod?method?=null;

try?{

method?=?(HandlerMethod)?handler;

}catch?(Exception?e)?{

writer?=?response.getWriter();

ResponseVO?responseVO?=?ResponseCode.buildEnumResponseVO(ResponseCode.REQUEST_URL_NOT_SERVICE,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

IsLogin?isLogin?=?method.getMethodAnnotation(IsLogin.class);

if(null?==?isLogin){

returntrue;

}

response.setCharacterEncoding("utf-8");

String?token?=?request.getHeader("token");

String?uid?=?request.getHeader("uid");

//token不存在

if(StringUtils.isEmpty(token))?{

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.LOGIN_TOKEN_NOT_NULL,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

if(StringUtils.isEmpty(uid)){

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.USERID_NOT_NULL,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

Login?login?=?JWT.unsign(token,?Login.class);

//解密token后的loginId與用戶傳來(lái)的loginId判斷是否一致

if(null?==?login?||?!StringUtils.equals(login.getUid(),?uid)){

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.USERID_NOT_UNAUTHORIZED,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

//驗(yàn)證登錄時(shí)間

RedisLogin?redisLogin?=?(RedisLogin)JedisUtils.getObject(uid);

if(null?==?redisLogin){

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.RESPONSE_CODE_UNLOGIN_ERROR,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

if(!StringUtils.equals(token,?redisLogin.getToken())){

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.USERID_NOT_UNAUTHORIZED,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

//系統(tǒng)時(shí)間>有效期(說(shuō)明已經(jīng)超過(guò)有效期)

if?(System.currentTimeMillis()?>?redisLogin.getRefTime())?{

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.LOGIN_TIME_EXP,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

//重新刷新有效期

redisLogin?=new?RedisLogin(uid,?token,?System.currentTimeMillis()?+?60L*?1000L*?30L);

JedisUtils.setObject(uid?,?redisLogin,360000000);

returntrue;

}

publicvoid?postHandle(HttpServletRequest?request,?HttpServletResponse?response,?Object?handler,

ModelAndView?modelAndView)throws?Exception?{

}

publicvoid?afterCompletion(HttpServletRequest?request,?HttpServletResponse?response,?Object?handler,?Exception?ex)

throws?Exception?{

}

privatevoid?responseMessage(HttpServletResponse?response,?PrintWriter?out,?ResponseVO?responseVO)?{

response.setContentType("application/json;?charset=utf-8");

JSONObject?result?=new?JSONObject();

result.put("result",?responseVO);

out.print(result);

out.flush();

out.close();

}

}

[java]view plaincopyprint?

publicclass?LoginInterceptorimplements?HandlerInterceptor{

publicboolean?preHandle(HttpServletRequest?request,?HttpServletResponse?response,?Object?handler)

throws?Exception?{

PrintWriter?writer?=null;

HandlerMethod?method?=null;

try?{

method?=?(HandlerMethod)?handler;

}catch?(Exception?e)?{

writer?=?response.getWriter();

ResponseVO?responseVO?=?ResponseCode.buildEnumResponseVO(ResponseCode.REQUEST_URL_NOT_SERVICE,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

IsLogin?isLogin?=?method.getMethodAnnotation(IsLogin.class);

if(null?==?isLogin){

returntrue;

}

response.setCharacterEncoding("utf-8");

String?token?=?request.getHeader("token");

String?uid?=?request.getHeader("uid");

//token不存在

if(StringUtils.isEmpty(token))?{

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.LOGIN_TOKEN_NOT_NULL,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

if(StringUtils.isEmpty(uid)){

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.USERID_NOT_NULL,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

Login?login?=?JWT.unsign(token,?Login.class);

//解密token后的loginId與用戶傳來(lái)的loginId判斷是否一致

if(null?==?login?||?!StringUtils.equals(login.getUid(),?uid)){

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.USERID_NOT_UNAUTHORIZED,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

//驗(yàn)證登錄時(shí)間

RedisLogin?redisLogin?=?(RedisLogin)JedisUtils.getObject(uid);

if(null?==?redisLogin){

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.RESPONSE_CODE_UNLOGIN_ERROR,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

if(!StringUtils.equals(token,?redisLogin.getToken())){

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.USERID_NOT_UNAUTHORIZED,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

//系統(tǒng)時(shí)間>有效期(說(shuō)明已經(jīng)超過(guò)有效期)

if?(System.currentTimeMillis()?>?redisLogin.getRefTime())?{

writer?=?response.getWriter();

ResponseVO?responseVO?=?LoginResponseCode.buildEnumResponseVO(LoginResponseCode.LOGIN_TIME_EXP,false);

responseMessage(response,?writer,?responseVO);

returnfalse;

}

//重新刷新有效期

redisLogin?=new?RedisLogin(uid,?token,?System.currentTimeMillis()?+?60L*?1000L*?30L);

JedisUtils.setObject(uid?,?redisLogin,360000000);

returntrue;

}

publicvoid?postHandle(HttpServletRequest?request,?HttpServletResponse?response,?Object?handler,

ModelAndView?modelAndView)throws?Exception?{

}

publicvoid?afterCompletion(HttpServletRequest?request,?HttpServletResponse?response,?Object?handler,?Exception?ex)

throws?Exception?{

}

privatevoid?responseMessage(HttpServletResponse?response,?PrintWriter?out,?ResponseVO?responseVO)?{

response.setContentType("application/json;?charset=utf-8");

JSONObject?result?=new?JSONObject();

result.put("result",?responseVO);

out.print(result);

out.flush();

out.close();

}

}

public class LoginInterceptor implements HandlerInterceptor{

public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)

throws Exception {

PrintWriter writer = null;

HandlerMethod method = null;

try {

method = (HandlerMethod) handler;

} catch (Exception e) {

writer = response.getWriter();

ResponseVO responseVO = ResponseCode.buildEnumResponseVO(ResponseCode.REQUEST_URL_NOT_SERVICE, false);

responseMessage(response, writer, responseVO);

return false;

}

IsLogin isLogin = method.getMethodAnnotation(IsLogin.class);

if(null == isLogin){

return true;

}

response.setCharacterEncoding("utf-8");

String token = request.getHeader("token");

String uid = request.getHeader("uid");

//token不存在

if(StringUtils.isEmpty(token)) {

writer = response.getWriter();

ResponseVO responseVO = LoginResponseCode.buildEnumResponseVO(LoginResponseCode.LOGIN_TOKEN_NOT_NULL, false);

responseMessage(response, writer, responseVO);

return false;

}

if(StringUtils.isEmpty(uid)){

writer = response.getWriter();

ResponseVO responseVO = LoginResponseCode.buildEnumResponseVO(LoginResponseCode.USERID_NOT_NULL, false);

responseMessage(response, writer, responseVO);

return false;

}

Login login = JWT.unsign(token, Login.class);

//解密token后的loginId與用戶傳來(lái)的loginId判斷是否一致

if(null == login || !StringUtils.equals(login.getUid(), uid)){

writer = response.getWriter();

ResponseVO responseVO = LoginResponseCode.buildEnumResponseVO(LoginResponseCode.USERID_NOT_UNAUTHORIZED, false);

responseMessage(response, writer, responseVO);

return false;

}

//驗(yàn)證登錄時(shí)間

RedisLogin redisLogin = (RedisLogin)JedisUtils.getObject(uid);

if(null == redisLogin){

writer = response.getWriter();

ResponseVO responseVO = LoginResponseCode.buildEnumResponseVO(LoginResponseCode.RESPONSE_CODE_UNLOGIN_ERROR, false);

responseMessage(response, writer, responseVO);

return false;

}

if(!StringUtils.equals(token, redisLogin.getToken())){

writer = response.getWriter();

ResponseVO responseVO = LoginResponseCode.buildEnumResponseVO(LoginResponseCode.USERID_NOT_UNAUTHORIZED, false);

responseMessage(response, writer, responseVO);

return false;

}

//系統(tǒng)時(shí)間>有效期(說(shuō)明已經(jīng)超過(guò)有效期)

if (System.currentTimeMillis() > redisLogin.getRefTime()) {

writer = response.getWriter();

ResponseVO responseVO = LoginResponseCode.buildEnumResponseVO(LoginResponseCode.LOGIN_TIME_EXP, false);

responseMessage(response, writer, responseVO);

return false;

}

//重新刷新有效期

redisLogin = new RedisLogin(uid, token, System.currentTimeMillis() + 60L* 1000L* 30L);

JedisUtils.setObject(uid , redisLogin, 360000000);

return true;

}

public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,

ModelAndView modelAndView) throws Exception {

}

public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)

throws Exception {

}

private void responseMessage(HttpServletResponse response, PrintWriter out, ResponseVO responseVO) {

response.setContentType("application/json; charset=utf-8");

JSONObject result = new JSONObject();

result.put("result", responseVO);

out.print(result);

out.flush();

out.close();

}

}

7. 定義異常的LoginResponseCode

Java代碼

publicenum?LoginResponseCode?{

USERID_NOT_NULL(3001,"用戶id不能為空."),

LOGIN_TOKEN_NOT_NULL(3002,"登錄token不能為空."),

USERID_NOT_UNAUTHORIZED(3003,"用戶token或ID驗(yàn)證不通過(guò)"),

RESPONSE_CODE_UNLOGIN_ERROR(421,"未登錄異常"),

LOGIN_TIME_EXP(3004,"登錄時(shí)間超長(zhǎng)是钥,請(qǐng)重新登錄");

//?成員變量

privateint?code;//狀態(tài)碼

private?String?message;//返回消息

//?構(gòu)造方法

private?LoginResponseCode(int?code,String?message)?{

this.code?=?code;

this.message?=?message;

}

publicint?getCode()?{

return?code;

}

publicvoid?setCode(int?code)?{

this.code?=?code;

}

public?String?getMessage()?{

return?message;

}

publicvoid?setMessage(String?message)?{

this.message?=?message;

}

publicstatic?ResponseVO?buildEnumResponseVO(LoginResponseCode?responseCode,?Object?data)?{

returnnew?ResponseVO(responseCode.getCode(),responseCode.getMessage(),data);

}

publicstatic?Map?buildReturnMap(LoginResponseCode?responseCode,?Object?data)?{

Map?map?=new?HashMap();

map.put("code",?responseCode.getCode());

map.put("message",?responseCode.getMessage());

map.put("data",?data);

return?map;

}

}

[java]view plaincopyprint?

publicenum?LoginResponseCode?{

USERID_NOT_NULL(3001,"用戶id不能為空."),

LOGIN_TOKEN_NOT_NULL(3002,"登錄token不能為空."),

USERID_NOT_UNAUTHORIZED(3003,"用戶token或ID驗(yàn)證不通過(guò)"),

RESPONSE_CODE_UNLOGIN_ERROR(421,"未登錄異常"),

LOGIN_TIME_EXP(3004,"登錄時(shí)間超長(zhǎng)掠归,請(qǐng)重新登錄");

//?成員變量

privateint?code;//狀態(tài)碼

private?String?message;//返回消息

//?構(gòu)造方法

private?LoginResponseCode(int?code,String?message)?{

this.code?=?code;

this.message?=?message;

}

publicint?getCode()?{

return?code;

}

publicvoid?setCode(int?code)?{

this.code?=?code;

}

public?String?getMessage()?{

return?message;

}

publicvoid?setMessage(String?message)?{

this.message?=?message;

}

publicstatic?ResponseVO?buildEnumResponseVO(LoginResponseCode?responseCode,?Object?data)?{

returnnew?ResponseVO(responseCode.getCode(),responseCode.getMessage(),data);

}

publicstatic?Map?buildReturnMap(LoginResponseCode?responseCode,?Object?data)?{

Map?map?=new?HashMap();

map.put("code",?responseCode.getCode());

map.put("message",?responseCode.getMessage());

map.put("data",?data);

return?map;

}

}

public enum LoginResponseCode {

USERID_NOT_NULL(3001,"用戶id不能為空."),

LOGIN_TOKEN_NOT_NULL(3002,"登錄token不能為空."),

USERID_NOT_UNAUTHORIZED(3003, "用戶token或ID驗(yàn)證不通過(guò)"),

RESPONSE_CODE_UNLOGIN_ERROR(421, "未登錄異常"),

LOGIN_TIME_EXP(3004, "登錄時(shí)間超長(zhǎng)缅叠,請(qǐng)重新登錄");

// 成員變量

private int code; //狀態(tài)碼

private String message; //返回消息

// 構(gòu)造方法

private LoginResponseCode(int code,String message) {

this.code = code;

this.message = message;

}

public int getCode() {

return code;

}

public void setCode(int code) {

this.code = code;

}

public String getMessage() {

return message;

}

public void setMessage(String message) {

this.message = message;

}

public static ResponseVO buildEnumResponseVO(LoginResponseCode responseCode, Object data) {

return new ResponseVO(responseCode.getCode(),responseCode.getMessage(),data);

}

public static Map buildReturnMap(LoginResponseCode responseCode, Object data) {

Map map = new HashMap();

map.put("code", responseCode.getCode());

map.put("message", responseCode.getMessage());

map.put("data", data);

return map;

}

}

8. 編寫(xiě)統(tǒng)一sso單點(diǎn)登錄接口:

Java代碼

@RequestMapping(value?="/login",?method?=?RequestMethod.POST)

public?Map?login(@RequestBody?JSONObject?json){

String?loginName?=?json.optString("loginName");

String?password?=?json.optString("password");

//校驗(yàn)用戶名不能為空

if(StringUtils.isEmpty(loginName)){

return?MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_USER_NAME_IS_NOT_EMPTY,null);

}

//校驗(yàn)用戶密碼不能為空

if(StringUtils.isEmpty(password)){

return?MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_PWD_CAN_NOT_BE_EMPTY,null);

}

//根據(jù)用戶名查詢數(shù)據(jù)庫(kù)用戶信息

User?user?=?systemService.getBaseUserByLoginName(loginName);

//用戶名或密碼不正確

if(null?==?user){

return?MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_USER_VALIDATE_NO_SUCCESS,false);

}

boolean?isValidate?=?systemService.validatePassword(password,?user.getPassword());

if(!isValidate){

return?MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_USER_VALIDATE_NO_SUCCESS,false);

}

if(isValidate){

//HttpSession?session?=request.getSession(false);

Login?login?=new?Login(user.getId(),?user.getLoginName(),?user.getPassword());

//給用戶jwt加密生成token

String?token?=?JWT.sign(login,?60L*?1000L*?30L);

Map?result?=new?HashMap();

result.put("loginToken",?token);

result.put("userId",?user.getId());

result.put("user",?user);

//保存用戶信息到session

//session.setAttribute(user.getId()?+?"@@"?+?token,?user);

//重建用戶信息

this.rebuildLoginUser(user.getId(),?token);

return?ResponseCode.buildReturnMap(ResponseCode.RESPONSE_CODE_LOGIN_SUCCESS,?result);

}

return?ResponseCode.buildReturnMap(ResponseCode.USER_LOGIN_PWD_ERROR,false);

}

[java]view plaincopyprint?

@RequestMapping(value?="/login",?method?=?RequestMethod.POST)

public?Map?login(@RequestBody?JSONObject?json){

String?loginName?=?json.optString("loginName");

String?password?=?json.optString("password");

//校驗(yàn)用戶名不能為空

if(StringUtils.isEmpty(loginName)){

return?MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_USER_NAME_IS_NOT_EMPTY,null);

}

//校驗(yàn)用戶密碼不能為空

if(StringUtils.isEmpty(password)){

return?MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_PWD_CAN_NOT_BE_EMPTY,null);

}

//根據(jù)用戶名查詢數(shù)據(jù)庫(kù)用戶信息

User?user?=?systemService.getBaseUserByLoginName(loginName);

//用戶名或密碼不正確

if(null?==?user){

return?MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_USER_VALIDATE_NO_SUCCESS,false);

}

boolean?isValidate?=?systemService.validatePassword(password,?user.getPassword());

if(!isValidate){

return?MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_USER_VALIDATE_NO_SUCCESS,false);

}

if(isValidate){

//HttpSession?session?=request.getSession(false);

Login?login?=new?Login(user.getId(),?user.getLoginName(),?user.getPassword());

//給用戶jwt加密生成token

String?token?=?JWT.sign(login,?60L*?1000L*?30L);

Map?result?=new?HashMap();

result.put("loginToken",?token);

result.put("userId",?user.getId());

result.put("user",?user);

//保存用戶信息到session

//session.setAttribute(user.getId()?+?"@@"?+?token,?user);

//重建用戶信息

this.rebuildLoginUser(user.getId(),?token);

return?ResponseCode.buildReturnMap(ResponseCode.RESPONSE_CODE_LOGIN_SUCCESS,?result);

}

return?ResponseCode.buildReturnMap(ResponseCode.USER_LOGIN_PWD_ERROR,false);

}

@RequestMapping(value = "/login", method = RequestMethod.POST)

public Map login(@RequestBody JSONObject json){

String loginName = json.optString("loginName");

String password = json.optString("password");

//校驗(yàn)用戶名不能為空

if(StringUtils.isEmpty(loginName)){

return MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_USER_NAME_IS_NOT_EMPTY, null);

}

//校驗(yàn)用戶密碼不能為空

if(StringUtils.isEmpty(password)){

return MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_PWD_CAN_NOT_BE_EMPTY, null);

}

//根據(jù)用戶名查詢數(shù)據(jù)庫(kù)用戶信息

User user = systemService.getBaseUserByLoginName(loginName);

//用戶名或密碼不正確

if(null == user){

return MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_USER_VALIDATE_NO_SUCCESS, false);

}

boolean isValidate = systemService.validatePassword(password, user.getPassword());

if(!isValidate){

return MemberResponseCode.buildReturnMap(MemberResponseCode.RESPONSE_CODE_USER_VALIDATE_NO_SUCCESS, false);

}

if(isValidate){

//HttpSession session =request.getSession(false);

Login login = new Login(user.getId(), user.getLoginName(), user.getPassword());

//給用戶jwt加密生成token

String token = JWT.sign(login, 60L* 1000L* 30L);

Map result =new HashMap();

result.put("loginToken", token);

result.put("userId", user.getId());

result.put("user", user);

//保存用戶信息到session

//session.setAttribute(user.getId() + "@@" + token, user);

//重建用戶信息

this.rebuildLoginUser(user.getId(), token);

return ResponseCode.buildReturnMap(ResponseCode.RESPONSE_CODE_LOGIN_SUCCESS, result);

}

return ResponseCode.buildReturnMap(ResponseCode.USER_LOGIN_PWD_ERROR, false);

}

9. 測(cè)試sso單點(diǎn)登錄:

返回結(jié)果集:

Java代碼

{

"message":"用戶登錄成功",

"data":?{

"loginToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MDkzODA1OTU0NTksInBheWxvYWQiOiJ7XCJ1aWRcIjpcIjExXCIsXCJsb2dpbk5hbWVcIjpcImFkbWluXCIsXCJwYXNzd29yZFwiOlwiZjU0NGQxM2QyY2EwNDU5ZGQ0ZTU1NzVjNmZkYWIzMzM0MzE1MWFlZjgwYmE5ZTNiN2U1ZjM2MzJcIn0ifQ.56L60WtxHXSu9vNs6XsWy5zbmc3kP_IWG1YpReK50DM",

"userId":"11",

"user":?{

"QQ":"2147775633",

"id":"11",

"isNewRecord":false,

"remarks":"",

"createDate":"2017-08-08?08:08:08",

"updateDate":"2017-10-29?11:23:50",

"loginName":"admin",

"no":"00012",

"name":"admin",

"email":"2147775633@qq.com",

"phone":"400000000",

"mobile":"13888888888",

"userType":"",

"loginIp":"0:0:0:0:0:0:0:1",

"loginDate":"2017-10-30?10:48:06",

"loginFlag":"1",

"photo":"",

"idCard":"420888888888888888",

"oldLoginIp":"0:0:0:0:0:0:0:1",

"oldLoginDate":"2017-10-30?10:48:06",

"roleNames":"",

"admin":false

}

},

"code":200

}

愿意了解框架技術(shù)或者源碼的朋友直接求求交流分享技術(shù):3133806896

分布式的一些解決方案,有愿意了解的朋友可以找我們團(tuán)隊(duì)探討

更多詳細(xì)源碼參考來(lái)源

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末虏冻,一起剝皮案震驚了整個(gè)濱河市肤粱,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌厨相,老刑警劉巖领曼,帶你破解...
    沈念sama閱讀 206,126評(píng)論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異蛮穿,居然都是意外死亡庶骄,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,254評(píng)論 2 382
  • 文/潘曉璐 我一進(jìn)店門(mén)践磅,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)单刁,“玉大人,你說(shuō)我怎么就攤上這事府适「岱桑” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 152,445評(píng)論 0 341
  • 文/不壞的土叔 我叫張陵檐春,是天一觀的道長(zhǎng)逻淌。 經(jīng)常有香客問(wèn)我,道長(zhǎng)疟暖,這世上最難降的妖魔是什么卡儒? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 55,185評(píng)論 1 278
  • 正文 為了忘掉前任,我火速辦了婚禮誓篱,結(jié)果婚禮上朋贬,老公的妹妹穿的比我還像新娘。我一直安慰自己窜骄,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,178評(píng)論 5 371
  • 文/花漫 我一把揭開(kāi)白布摆屯。 她就那樣靜靜地躺著邻遏,像睡著了一般。 火紅的嫁衣襯著肌膚如雪虐骑。 梳的紋絲不亂的頭發(fā)上准验,一...
    開(kāi)封第一講書(shū)人閱讀 48,970評(píng)論 1 284
  • 那天,我揣著相機(jī)與錄音廷没,去河邊找鬼糊饱。 笑死,一個(gè)胖子當(dāng)著我的面吹牛颠黎,可吹牛的內(nèi)容都是我干的另锋。 我是一名探鬼主播滞项,決...
    沈念sama閱讀 38,276評(píng)論 3 399
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼夭坪!你這毒婦竟也來(lái)了文判?” 一聲冷哼從身側(cè)響起,我...
    開(kāi)封第一講書(shū)人閱讀 36,927評(píng)論 0 259
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤室梅,失蹤者是張志新(化名)和其女友劉穎戏仓,沒(méi)想到半個(gè)月后,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體亡鼠,經(jīng)...
    沈念sama閱讀 43,400評(píng)論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡赏殃,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 35,883評(píng)論 2 323
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了间涵。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片嗓奢。...
    茶點(diǎn)故事閱讀 37,997評(píng)論 1 333
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖浑厚,靈堂內(nèi)的尸體忽然破棺而出股耽,到底是詐尸還是另有隱情,我是刑警寧澤钳幅,帶...
    沈念sama閱讀 33,646評(píng)論 4 322
  • 正文 年R本政府宣布物蝙,位于F島的核電站,受9級(jí)特大地震影響敢艰,放射性物質(zhì)發(fā)生泄漏诬乞。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,213評(píng)論 3 307
  • 文/蒙蒙 一钠导、第九天 我趴在偏房一處隱蔽的房頂上張望震嫉。 院中可真熱鬧,春花似錦牡属、人聲如沸票堵。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 30,204評(píng)論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)悴势。三九已至,卻和暖如春措伐,著一層夾襖步出監(jiān)牢的瞬間特纤,已是汗流浹背。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 31,423評(píng)論 1 260
  • 我被黑心中介騙來(lái)泰國(guó)打工侥加, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留捧存,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 45,423評(píng)論 2 352
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像昔穴,于是被迫代替她去往敵國(guó)和親镰官。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,722評(píng)論 2 345

推薦閱讀更多精彩內(nèi)容