|
@@ -1,9 +1,11 @@
|
|
|
package com.yonge.cooleshow.auth.web.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yonge.cooleshow.auth.api.dto.QRLoginDto;
|
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
+import com.yonge.cooleshow.auth.api.vo.SysUserVo;
|
|
|
import com.yonge.cooleshow.auth.core.service.CustomTokenServices;
|
|
|
import com.yonge.cooleshow.auth.enums.EClientType;
|
|
|
import com.yonge.cooleshow.auth.service.SysUserService;
|
|
@@ -41,6 +43,7 @@ import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.IOException;
|
|
|
+import java.text.MessageFormat;
|
|
|
import java.util.Base64;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Map;
|
|
@@ -108,7 +111,13 @@ public class TokenController extends BaseController {
|
|
|
if (authUser != null) {
|
|
|
SysUser sysUser = userService.queryUserInfoWithIMToken(authUser.getUserId(), EClientType.valueOf(clientType));
|
|
|
|
|
|
- return succeed(sysUser);
|
|
|
+ String imUserId = String.valueOf(sysUser.getId());
|
|
|
+ if (EClientType.STUDENT.match(clientType)) {
|
|
|
+ imUserId = MessageFormat.format("{0}:{1}",imUserId, clientType);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 封装返回参数
|
|
|
+ return succeed(JSON.parseObject(JSON.toJSONString(sysUser), SysUserVo.class).imUserId(imUserId));
|
|
|
}
|
|
|
return failed("获取用户信息失败");
|
|
|
}
|