|
@@ -7,6 +7,9 @@ import com.dingtalk.api.DefaultDingTalkClient;
|
|
|
import com.dingtalk.api.DingTalkClient;
|
|
|
import com.dingtalk.api.request.OapiGettokenRequest;
|
|
|
import com.dingtalk.api.response.OapiGettokenResponse;
|
|
|
+import com.fasterxml.jackson.core.JsonParser;
|
|
|
+import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.nimbusds.jwt.SignedJWT;
|
|
|
import com.taobao.api.ApiException;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -96,8 +99,7 @@ public class ThirdLoginController
|
|
|
*/
|
|
|
@ApiOperation(value = "登录接口", notes = "用户登录地址", httpMethod = "GET")
|
|
|
@RequestMapping(value = {"/login"})
|
|
|
- public RetResult login(@RequestParam("username") String username, @RequestParam("password") String password, HttpServletRequest request)
|
|
|
- {
|
|
|
+ public RetResult login(@RequestParam("username") String username, @RequestParam("password") String password, HttpServletRequest request) throws JsonProcessingException {
|
|
|
RetResult result = new RetResult();
|
|
|
Map<String, Object> data = new HashMap<String, Object>();
|
|
|
// //获取一个参数
|
|
@@ -121,8 +123,9 @@ public class ThirdLoginController
|
|
|
redisConnection.delete(userInfo.getId());
|
|
|
redisConnection.delete(oldToken);
|
|
|
}
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
redisConnection.setex(userInfo.getId(), 60 * 60 * 24 * 7, token);
|
|
|
- redisConnection.setex(token, 60 * 60 * 24 * 7, JSON.toJSONString(userInfo));
|
|
|
+ redisConnection.setex(token, 60 * 60 * 24 * 7, objectMapper.writeValueAsString(userInfo));
|
|
|
redisConnection.close();
|
|
|
_logger.debug("token >>>" + token);
|
|
|
|