mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-08-02 21:50:43 +08:00
Fix some team project bugs
This commit is contained in:
@ -92,6 +92,7 @@ public class Chat2dbWebMvcConfigurer implements WebMvcConfigurer {
|
||||
return null;
|
||||
}
|
||||
if (!ValidStatusEnum.VALID.getCode().equals(user.getStatus())) {
|
||||
StpUtil.logout();
|
||||
throw new BusinessException("oauth.invalidUserName");
|
||||
}
|
||||
boolean admin = RoleCodeEnum.ADMIN.getCode().equals(user.getRoleCode());
|
||||
|
@ -1,6 +1,7 @@
|
||||
package ai.chat2db.server.start.controller.oauth;
|
||||
|
||||
import ai.chat2db.server.domain.api.enums.RoleCodeEnum;
|
||||
import ai.chat2db.server.domain.api.enums.ValidStatusEnum;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import ai.chat2db.server.domain.api.model.User;
|
||||
@ -50,6 +51,9 @@ public class OauthController {
|
||||
if (user == null) {
|
||||
throw new BusinessException("oauth.userNameNotExits");
|
||||
}
|
||||
if (!ValidStatusEnum.VALID.getCode().equals(user.getStatus())) {
|
||||
throw new BusinessException("oauth.invalidUserName");
|
||||
}
|
||||
if (RoleCodeEnum.DESKTOP.getDefaultUserId().equals(user.getId())) {
|
||||
throw new BusinessException("oauth.IllegalUserName");
|
||||
}
|
||||
|
Reference in New Issue
Block a user