修正字段写入
This commit is contained in:
parent
0ae5974dc6
commit
ccceffe7c4
|
|
@ -523,14 +523,14 @@ public class OAuth2Controller extends BaseController {
|
||||||
@ApiOperation("获取一个加密登录的登录用数据串")
|
@ApiOperation("获取一个加密登录的登录用数据串")
|
||||||
@GetMapping("sm4/encrypted/data")
|
@GetMapping("sm4/encrypted/data")
|
||||||
public RestResult<String> getSm4EncryptedData(HttpServletRequest request) {
|
public RestResult<String> getSm4EncryptedData(HttpServletRequest request) {
|
||||||
LoginMessage loginMessage = getLoginMessage(request);
|
AICUser loginUser = getLoginUser(request);
|
||||||
if (loginMessage == null) {
|
if (loginUser == null) {
|
||||||
return RestResult.error(ResultCode.USER_NOT_LOGGED_IN);
|
return RestResult.error(ResultCode.USER_NOT_LOGGED_IN);
|
||||||
}
|
}
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("userId", loginMessage.getUserId());
|
jsonObject.put("userId", loginUser.getPrimaryKey());
|
||||||
jsonObject.put("username", loginMessage.getUsername());
|
jsonObject.put("username", loginUser.getEname());
|
||||||
jsonObject.put("nickname", loginMessage.getNickName());
|
jsonObject.put("nickname", loginUser.getName());
|
||||||
jsonObject.put("expired", System.currentTimeMillis() + 1000 * 60 * 5);// 增加有效期
|
jsonObject.put("expired", System.currentTimeMillis() + 1000 * 60 * 5);// 增加有效期
|
||||||
return RestResult.ok(SM4Utils.encrypt(jsonObject.toJSONString(), sm4Key));
|
return RestResult.ok(SM4Utils.encrypt(jsonObject.toJSONString(), sm4Key));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue