31 lines
737 B
Java
31 lines
737 B
Java
package com.tiesheng.login.service;
|
|
|
|
import com.tiesheng.login.config.TieshengLoginConfigurer;
|
|
import com.tiesheng.util.exception.ApiException;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
/**
|
|
* @author hao
|
|
*/
|
|
@Service
|
|
public class LoginService {
|
|
|
|
@Autowired(required = false)
|
|
TieshengLoginConfigurer tieshengLoginConfigurer;
|
|
|
|
|
|
/**
|
|
* 检查配置
|
|
*/
|
|
public void checkLoginConfigurer(Consumer<TieshengLoginConfigurer> consumer) {
|
|
if (tieshengLoginConfigurer == null) {
|
|
throw new ApiException("未配置登录逻辑");
|
|
}
|
|
consumer.accept(tieshengLoginConfigurer);
|
|
}
|
|
|
|
}
|