File tree Expand file tree Collapse file tree 4 files changed +9
-25
lines changed
base/src/main/java/com/tinyengine/it Expand file tree Collapse file tree 4 files changed +9
-25
lines changed Original file line number Diff line number Diff line change @@ -322,11 +322,16 @@ public enum ExceptionEnum implements IBaseError {
322322 * Cm 339 exception enum.
323323 */
324324 CM339 ("CM339" , "token检验失败,请重新登录" ),
325+
325326 /**
326327 * Cm 340 exception enum.
327328 */
328- CM340 ("CM340" , "请求资源不存在" );
329+ CM340 ("CM340" , "请求资源不存在" ),
329330
331+ /**
332+ * Cm 341 exception enum.
333+ */
334+ CM341 ("CM341" , "组织在当前用户组织列表中匹配不到" );
330335 /**
331336 * 错误码
332337 */
Original file line number Diff line number Diff line change @@ -91,8 +91,6 @@ public class LoginController {
9191
9292 @ Autowired
9393 LoginUserContext loginUserContext ;
94- @ Autowired
95- private TenantService tenantService ;
9694
9795 /**
9896 * 注册
@@ -241,12 +239,12 @@ public Result<ValidationResult> validateToken(@RequestParam String token) {
241239 @ SystemControllerLog (description = "设置当前组织" )
242240 @ GetMapping ("/user/tenant" )
243241 public Result <SSOTicket > setTenant (@ RequestParam Integer tenantId ) {
242+ List <Tenant > tenants = authUsersUnitsRolesMapper .queryAllTenantByUserId (Integer .valueOf (loginUserContext .getLoginUserId ()));
243+
244244 if (tenantId == null ) {
245245 return Result .failed (ExceptionEnum .CM320 );
246246 }
247247
248- List <Tenant > tenants = tenantService .findTenantByTenantId (tenantId );
249-
250248 if (tenants == null || tenants .isEmpty ()) {
251249 return Result .failed (ExceptionEnum .CM337 );
252250 }
@@ -264,7 +262,7 @@ public Result<SSOTicket> setTenant(@RequestParam Integer tenantId) {
264262 }
265263
266264 if (!found ) {
267- return Result .failed (ExceptionEnum .CM337 );
265+ return Result .failed (ExceptionEnum .CM341 );
268266 }
269267
270268 // 通过 RequestContextHolder 获取请求
Original file line number Diff line number Diff line change @@ -46,14 +46,6 @@ public interface TenantService extends IService<Tenant> {
4646 */
4747 List <Tenant > findTenantByCondition (Tenant tenant );
4848
49- /**
50- * 根据条件查询表t_tenant信息
51- *
52- * @param tenantId the tenantId
53- * @return the list
54- */
55- List <Tenant > findTenantByTenantId (Integer tenantId );
56-
5749 /**
5850 * 根据主键id删除t_tenant数据
5951 *
Original file line number Diff line number Diff line change @@ -81,17 +81,6 @@ public List<Tenant> findTenantByCondition(Tenant tenant) {
8181 return baseMapper .queryTenantByCondition (tenant );
8282 }
8383
84- /**
85- * 根据条件查询表t_tenant信息
86- *
87- * @param tenantId the tenantId
88- * @return the list
89- */
90- @ Override
91- public List <Tenant > findTenantByTenantId (Integer tenantId ) {
92- return baseMapper .selectList (new QueryWrapper <Tenant >().eq ("id" , tenantId ));
93- }
94-
9584 /**
9685 * 根据主键id删除表t_tenant数据
9786 *
You can’t perform that action at this time.
0 commit comments