调整接口参数传递数量
This commit is contained in:
parent
f58c1f92da
commit
041c3ce193
|
|
@ -3,6 +3,7 @@ package com.chinaweal.aiccs.org.controller;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.chinaweal.aiccs.common.base.controller.BaseController;
|
import com.chinaweal.aiccs.common.base.controller.BaseController;
|
||||||
|
import com.chinaweal.aiccs.common.base.entity.dto.login.LoginMessage;
|
||||||
import com.chinaweal.aiccs.common.util.OAuthTokenUtils;
|
import com.chinaweal.aiccs.common.util.OAuthTokenUtils;
|
||||||
import com.chinaweal.aiccs.common.util.SM4Utils;
|
import com.chinaweal.aiccs.common.util.SM4Utils;
|
||||||
import com.chinaweal.aiccs.common.util.StringUtils;
|
import com.chinaweal.aiccs.common.util.StringUtils;
|
||||||
|
|
@ -522,11 +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) {
|
||||||
AICUser loginUser = getLoginUser(request);
|
LoginMessage loginMessage = getLoginMessage(request);
|
||||||
if (loginUser == null) {
|
if (loginMessage == null) {
|
||||||
return RestResult.error(ResultCode.USER_NOT_LOGGED_IN);
|
return RestResult.error(ResultCode.USER_NOT_LOGGED_IN);
|
||||||
}
|
}
|
||||||
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(loginUser));
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("userId", loginMessage.getUserId());
|
||||||
|
jsonObject.put("username", loginMessage.getUsername());
|
||||||
|
jsonObject.put("nickname", loginMessage.getNickName());
|
||||||
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