提交 d39767c7 编写于 作者: rushui.chen's avatar rushui.chen

20190904 对代码进行测试

上级 28a32e48
流水线 #14015 已失败 于阶段
in 1 second
......@@ -142,18 +142,17 @@ public class LoginController extends AccountBaseController {
@GetMapping("/logout")
public PicaResponse loginOut() {
//只有在登录状态下才能调用此接口;
AccountUser accountUser = super.getAccountUser();
String token = accountUser.getToken();
String token = super.getToken();
if (StringUtils.isNotEmpty(token)) {
Integer id = accountUser.getAcctId();
Integer id = super.getAcctId();
//记录登录日志
LogLoginEntity entity = AccountLogEntityUtils.getLogLoginEntity(id, super.getProductType(), super.getSourceType(),
AccountEnumType.LOGIN_OUT.getCode(),super.getIpAddr(),AccountEnumType.LOGIN_STATUS_SUCCESS.getCode(),AccountEnumType.LOG_TYPE_LOGIN.getCode());
AccountEnumType.LOGIN_OUT.getCode(), super.getIpAddr(), AccountEnumType.LOGIN_STATUS_SUCCESS.getCode(), AccountEnumType.LOG_TYPE_LOGIN.getCode());
picaLogUtils.info(entity);
if (redisClient.deleteToken(token)) {
return PicaResponse.toResponse();
}
}
return null;
return PicaResponse.toResponse();
}
}
package com.pica.cloud.account.account.server.controller;
import com.pica.cloud.account.account.server.entity.AccountUser;
import com.pica.cloud.account.account.server.entity.AccountUserInfoEntity;
import com.pica.cloud.account.account.server.entity.EncryptEntity;
import com.pica.cloud.account.account.server.req.PatientReq;
......@@ -30,7 +31,8 @@ public class UserInfoController extends AccountBaseController {
@ApiOperation("获取用户信息接口")
@GetMapping(value = "/user/info")
public PicaResponse getUserInfo() {
Integer userId = super.getPicaUser().getId();
AccountUser accountUser = super.getAccountUser();
Integer userId = accountUser.getId();
AccountUserInfoEntity userInfo = userInfoService.getUserInfo(userId);
return PicaResponse.toResponse(userInfo);
}
......
......@@ -64,6 +64,7 @@ public class TokenUtils {
Map<String, String> map = new HashMap<>();
map.put("token", newToken);
map.put("id", account.getId() + "");
map.put("acctId", account.getAcctId() + "");
map.put("mobile", account.getMobilePhone());
map.put("name", account.getMobilePhone().replaceAll("(\\d{3})\\d{4}(\\w{4})", "$1****$2"));
map.put("created_time", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(account.getCreatTime()));
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册