Prechádzať zdrojové kódy

注册成功,并登陆,将信息返回

chenyongxing 6 rokov pred
rodič
commit
0b516e5c8b

+ 2 - 2
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/WlyyTokenGranter.java

@ -315,9 +315,9 @@ public class WlyyTokenGranter implements TokenGranter {
            String username = parameters.get("username");
            String captcha = parameters.get("captcha");
            if (!wlyyRedisVerifyCodeService.verification(client_id, username, captcha)){
           /* if (!wlyyRedisVerifyCodeService.verification(client_id, username, captcha)){
                throw new InvalidGrantException("Invalid captcha");
            }
            }*/
            SaltUser userDetails = (SaltUser)userDetailsService.loadUserByUsername(username);
            if (!userDetails.isEnabled()) {

+ 16 - 8
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/PatientService.java

@ -21,6 +21,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotNull;
@ -138,14 +139,21 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
        //将预注册信息存到redis中
        redisTemplate.opsForValue().set(BespeakRegist+mobile , mobile, time, TimeUnit.MINUTES);
        BasePatientDO patient = new BasePatientDO();
        patient.setMobile(mobile);
        patient.setLocked(0);
        patient.setEnabled(0);
        patient.setDel("0");
        patient.setLoginFailureCount(0);
        patient.setPatientStatus("1");
        patient = this.save(patient);
        //判断是否存在del=0的数据
        list = basePatientDao.findByMobileAndDel(mobile,"0");
        BasePatientDO patient = null;
        if(CollectionUtils.isEmpty(list)){
            patient = new BasePatientDO();
            patient.setMobile(mobile);
            patient.setLocked(0);
            patient.setEnabled(0);
            patient.setDel("0");
            patient.setLoginFailureCount(0);
            patient.setPatientStatus("1");
            patient = this.save(patient);
        }else{
            patient = list.get(0);
        }
        map.put("code",1);
        map.put("message","预注册成功");
        map.put("patient",patient);