Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	common/common-request-mapping/src/main/java/com/yihu/jw/rm/patient/PatientRequestMapping.java
chenyongxing 6 years ago
parent
commit
a3965f116c

+ 6 - 1
business/base-service/src/main/java/com/yihu/jw/security/service/TokenService.java

@ -12,6 +12,7 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.UUID;
@Component
@Transactional(rollbackFor = Exception.class)
@ -79,7 +80,11 @@ public class TokenService extends BaseJpaService<Token, TokenDao> {
		Token token = new Token();
		token.setDel("1");
		token.setPlatform(3);
		token.setImei(openid);
		if(StringUtils.isBlank(openid)){
			token.setImei(UUID.randomUUID().toString().replace("-",""));
		}else{
			token.setImei(openid);
		}
		// 360天的有限期
		token.setTimeout(DateUtil.strToDate(DateUtil.getNextDay(DateUtil.getStringDate(DateUtil.YYYY_MM_DD), 360), DateUtil.YYYY_MM_DD));
		token.setToken(tokenStr);

+ 5 - 3
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientEndpoint.java

@ -128,7 +128,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
                String salt = UUID.randomUUID().toString().replace("-", "");
                patient.setSalt(salt);
                password = rsaService.decryptString(password);
                password = org.apache.commons.lang3.StringUtils.reverse(password);
                password = StringUtils.reverse(password);
                if(password.length()<6 || password.length()>20){
                    envelop.setMessage("密码长度需为6-20位");
                    envelop.setStatus(-1);
@ -136,7 +136,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
                }
                patient.setPassword(MD5.GetMD5Code(password + salt));
            }
            if(!"undefined".equals(openid) && org.apache.commons.lang3.StringUtils.isNotBlank(openid)){
            if(!"undefined".equals(openid) && StringUtils.isNotBlank(openid)){
                patient.setOpenid(openid);
                patient.setOpenidTime(new Date());
            }
@ -224,7 +224,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
            }
        }
        if(isLogin){
            if(org.apache.commons.lang3.StringUtils.isNotBlank(openId) && !"undefined".equals(openId)){
            if(StringUtils.isNotBlank(openId) && !"undefined".equals(openId)){
                //更新openId
                if(!openId.equals(p.getOpenid())){
                    patientService.updateOpenId(p.getId(), openId);
@ -238,6 +238,8 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
            map.put("name", p.getName());
            map.put("token", token.getToken());
            map.put("photo", p.getPhoto());
            envelop.setMessage("登陆成功");
            envelop.setStatus(200);
        }
        return envelop;
    }

+ 1 - 1
svr/svr-patient/src/main/java/com/yihu/jw/patient/interceptor/GateWayAOP.java

@ -21,7 +21,7 @@ public class GateWayAOP {
    private Logger logger = LoggerFactory.getLogger(GateWayAOP.class);
    //Controller层切点路径
    @Pointcut("execution(* com.yihu.jw..patient.endpoint..*.*(..))")
    @Pointcut("execution(* com.yihu.jw.patient.endpoint..*.*(..))")
    public void controllerAspect() {
    }

+ 4 - 0
svr/svr-patient/src/main/resources/application.yml

@ -134,6 +134,8 @@ spring:
    port: 6379 # Redis server port.
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
sms:
  clientId: EwC0iRSrcP
myFamily:
  qrCodeFailurTime: 2
##拦截器开关
@ -166,6 +168,8 @@ fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
myFamily:
  qrCodeFailurTime: 2
sms:
  clientId: EwC0iRSrcP # todo 待确认
##拦截器开关
interceptor:
  patient: