| | |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.system.domain.SysClient; |
| | | import org.dromara.system.domain.vo.SysClientVo; |
| | | import org.dromara.web.domain.vo.LoginVo; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 登录 |
| | | */ |
| | | static LoginVo login(String body, SysClient client, String grantType) { |
| | | static LoginVo login(String body, SysClientVo client, String grantType) { |
| | | // 授权类型和客户端id |
| | | String clientId = client.getClientId(); |
| | | String beanName = grantType + BASE_NAME; |
| | | if (!SpringUtils.containsBean(beanName)) { |
| | | throw new ServiceException("授权类型不正确!"); |
| | | } |
| | | IAuthStrategy instance = SpringUtils.getBean(beanName); |
| | | return instance.login(clientId, body, client); |
| | | return instance.login(body, client); |
| | | } |
| | | |
| | | /** |
| | | * 登录 |
| | | */ |
| | | LoginVo login(String clientId, String body, SysClient client); |
| | | LoginVo login(String body, SysClientVo client); |
| | | |
| | | } |