|
@ -5,10 +5,12 @@ import com.yihu.wlyy.logs.InterfaceCallLogs;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.util.SystemConf;
|
|
|
import com.yihu.wlyy.util.SystemData;
|
|
|
import com.yihu.wlyy.util.SystemDataRedis;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONObject;
|
|
|
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.stereotype.Component;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@ -29,6 +31,8 @@ import java.util.Date;
|
|
|
public class PatientInterceptor extends BaseInterceptor {
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(PatientInterceptor.class);
|
|
|
@Autowired
|
|
|
private SystemDataRedis systemDataRedis;
|
|
|
|
|
|
public static String status = "1";
|
|
|
|
|
@ -67,16 +71,18 @@ public class PatientInterceptor extends BaseInterceptor {
|
|
|
if (StringUtils.isEmpty(imei)) {
|
|
|
imei = openid;
|
|
|
}
|
|
|
|
|
|
//1.5.0 获取token redis
|
|
|
Token token = null;
|
|
|
if (platform == 3) {
|
|
|
token = SystemData.patientTokens.get(user);
|
|
|
token = systemDataRedis.getPatientToken(user);
|
|
|
// token = SystemData.patientTokens.get(user);
|
|
|
}
|
|
|
if (token == null) {
|
|
|
token = tokenDao.findByPatient(user, platform);
|
|
|
// 加入缓存
|
|
|
if (platform == 3) {
|
|
|
SystemData.patientTokens.put(user, token);
|
|
|
systemDataRedis.setPatientToken(token);
|
|
|
//SystemData.patientTokens.put(user, token);
|
|
|
}
|
|
|
}
|
|
|
if (token == null || StringUtils.isEmpty(tokenStr) || (token.getPlatform() != 1 && token.getPlatform() != 3)) {
|
|
@ -95,7 +101,8 @@ public class PatientInterceptor extends BaseInterceptor {
|
|
|
token.setCzrq(new Date());
|
|
|
// 更新内存
|
|
|
if (platform == 3) {
|
|
|
SystemData.patientTokens.put(user, token);
|
|
|
systemDataRedis.setPatientToken(token);
|
|
|
//SystemData.patientTokens.put(user, token);
|
|
|
}
|
|
|
// 更新数据库
|
|
|
tokenDao.save(token);
|