|
|
@@ -1,5 +1,6 @@ |
|
|
|
package com.tuoheng.config; |
|
|
|
|
|
|
|
import com.alibaba.druid.util.StringUtils; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.tuoheng.mapper.ClientUserMapper; |
|
|
@@ -35,6 +36,9 @@ public class LoginUserHandler implements HandlerMethodArgumentResolver { |
|
|
|
// header中获取用户token |
|
|
|
String token = request.getHeader("th-token"); |
|
|
|
String oUserJson = request.getHeader("o-user-json"); |
|
|
|
if(StringUtils.isEmpty(token) || StringUtils.isEmpty(oUserJson)){ |
|
|
|
return new LoginUser(); |
|
|
|
} |
|
|
|
String json = EncryptUtil.decodeUTF8StringBase64(oUserJson); |
|
|
|
JSONObject jsonObject = JSON.parseObject(json); |
|
|
|
String username = jsonObject.getString("username"); |