|
|
|
@ -5,6 +5,7 @@ import javax.annotation.Resource;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.enums.UserStatus;
|
|
|
|
|
import com.ruoyi.common.utils.*;
|
|
|
|
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
|
|
|
import com.ruoyi.system.domain.TDoctor;
|
|
|
|
|
import com.ruoyi.system.domain.req.AppRegisterReq;
|
|
|
|
|
import com.ruoyi.system.mapper.TDoctorMapper;
|
|
|
|
@ -12,6 +13,7 @@ import com.ruoyi.system.service.impl.UserTokenService;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.security.authentication.AuthenticationManager;
|
|
|
|
|
import org.springframework.security.authentication.BadCredentialsException;
|
|
|
|
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
|
|
|
@ -44,6 +46,9 @@ import java.util.Objects;
|
|
|
|
|
public class SysLoginService
|
|
|
|
|
{
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(SysLoginService.class);
|
|
|
|
|
|
|
|
|
|
@Value("${ruoyi.profile}")
|
|
|
|
|
private String uploadFilePath;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TokenService tokenService;
|
|
|
|
|
|
|
|
|
@ -141,6 +146,9 @@ public class SysLoginService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public AjaxResult loginForAppFillInfo(AppRegisterReq req) {
|
|
|
|
|
if (StringUtils.isNotEmpty(req.getMedicalLicense())) {
|
|
|
|
|
req.setMedicalLicense(FileUploadUtils.generateImage(req.getMedicalLicense(), uploadFilePath));
|
|
|
|
|
}
|
|
|
|
|
// 查询sys_user数据
|
|
|
|
|
SysUser sysUser = userService.selectUserByPhone(req.getPhone());
|
|
|
|
|
if (Objects.nonNull(sysUser)) {
|
|
|
|
|