|
@@ -12,6 +12,8 @@ import javax.servlet.http.HttpServletResponse;
|
|
import com.ym.mec.common.entity.ImResult;
|
|
import com.ym.mec.common.entity.ImResult;
|
|
import com.ym.mec.common.entity.ImUserModel;
|
|
import com.ym.mec.common.entity.ImUserModel;
|
|
import com.ym.mec.im.ImFeignService;
|
|
import com.ym.mec.im.ImFeignService;
|
|
|
|
+import com.ym.mec.im.UserFeignService;
|
|
|
|
+
|
|
import org.apache.commons.collections.MapUtils;
|
|
import org.apache.commons.collections.MapUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -58,6 +60,9 @@ public class BaseAuthenticationSuccessEventHandler extends SavedRequestAwareAuth
|
|
private ImFeignService imFeignService;
|
|
private ImFeignService imFeignService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private UserFeignService userFeignService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
private ClientDetailsService clientDetailsService;
|
|
private ClientDetailsService clientDetailsService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -128,6 +133,21 @@ public class BaseAuthenticationSuccessEventHandler extends SavedRequestAwareAuth
|
|
Map<String,Object> map = new HashMap<>(3);
|
|
Map<String,Object> map = new HashMap<>(3);
|
|
map.put("password", StringUtils.isEmpty(sysUser.getPassword())?false:true);
|
|
map.put("password", StringUtils.isEmpty(sysUser.getPassword())?false:true);
|
|
map.put("authentication",oAuth2AccessToken);
|
|
map.put("authentication",oAuth2AccessToken);
|
|
|
|
+
|
|
|
|
+ String tenantId = "1";
|
|
|
|
+ if (StringUtils.equalsIgnoreCase(clientId, "TEACHER")) {
|
|
|
|
+ // 查询老师所在分部
|
|
|
|
+ Integer organId = userFeignService.queryTeacherOrganId(sysUser.getId());
|
|
|
|
+ if (organId == 43) {
|
|
|
|
+ tenantId = "2";
|
|
|
|
+ }
|
|
|
|
+ } else if (StringUtils.equalsIgnoreCase(clientId, "STUDENT")) {
|
|
|
|
+ if (sysUser.getOrganId() == 43) {
|
|
|
|
+ tenantId = "2";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ map.put("tenantId", tenantId);
|
|
|
|
+
|
|
response.setContentType("application/json; charset=utf-8");
|
|
response.setContentType("application/json; charset=utf-8");
|
|
HttpResponseResult result = new HttpResponseResult(true, HttpStatus.OK.value(), map, "");
|
|
HttpResponseResult result = new HttpResponseResult(true, HttpStatus.OK.value(), map, "");
|
|
response.getWriter().write(objectMapper.writeValueAsString(result));
|
|
response.getWriter().write(objectMapper.writeValueAsString(result));
|