修改跳转至安眼大屏鉴权参数
This commit is contained in:
+2
-11
@@ -4,16 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.renkang.anyan.model.dto.HealthRoomDTO;
|
import com.renkang.anyan.model.dto.HealthRoomDTO;
|
||||||
import com.renkang.anyan.model.dto.HealthSignListParam;
|
import com.renkang.anyan.model.dto.HealthSignListParam;
|
||||||
import com.renkang.anyan.model.dto.MedicalAbnormalDTO;
|
import com.renkang.anyan.model.dto.MedicalAbnormalDTO;
|
||||||
import com.renkang.anyan.model.vo.BloodPressureList;
|
import com.renkang.anyan.model.vo.*;
|
||||||
import com.renkang.anyan.model.vo.HealthSignStatVO;
|
|
||||||
import com.renkang.anyan.model.vo.MedicalPeopleNumStatisticsVO;
|
|
||||||
import com.renkang.anyan.model.vo.WeightPressureList;
|
|
||||||
import com.renkang.anyan.model.vo.BloodSugarClockSList;
|
|
||||||
import com.renkang.anyan.model.vo.HospitalListVO;
|
|
||||||
import com.renkang.anyan.model.vo.HealthRoomBaseVO;
|
|
||||||
import com.renkang.anyan.model.vo.HealthPlaceHomDetailsVO;
|
|
||||||
import com.renkang.anyan.model.vo.MedicalAbnormalStatisticsVO;
|
|
||||||
import com.renkang.anyan.model.vo.MedicalAbnormalVO;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -115,5 +106,5 @@ public interface AnYanClient {
|
|||||||
* 公网环境获取服务访问token (目前仅用于访问安眼大屏, 不走缓存, 每次用现取)
|
* 公网环境获取服务访问token (目前仅用于访问安眼大屏, 不走缓存, 每次用现取)
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String publicNetworkTokenNoCache();
|
AuthResult publicNetworkTokenNoCache();
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-8
@@ -182,7 +182,7 @@ public class AnYanClientExecutor implements AnYanClient {
|
|||||||
public String publicNetworkToken(){
|
public String publicNetworkToken(){
|
||||||
String token = redisClientUtil.get(new RedisKeyPrefix(AnYanConstants.AN_YAN_API_TOKEN_PREFIX) ,"publicToken",String.class);
|
String token = redisClientUtil.get(new RedisKeyPrefix(AnYanConstants.AN_YAN_API_TOKEN_PREFIX) ,"publicToken",String.class);
|
||||||
if(StrUtil.isEmpty(token)){
|
if(StrUtil.isEmpty(token)){
|
||||||
AuthResult authResult = queryPublicToken();
|
AuthResult authResult = publicNetworkTokenNoCache();
|
||||||
if(null != authResult){
|
if(null != authResult){
|
||||||
token = authResult.getAccess_token();
|
token = authResult.getAccess_token();
|
||||||
int expireSeconds = ObjectUtil.isNotEmpty(authResult.getExpires_in())? authResult.getExpires_in() : 7200;
|
int expireSeconds = ObjectUtil.isNotEmpty(authResult.getExpires_in())? authResult.getExpires_in() : 7200;
|
||||||
@@ -192,7 +192,8 @@ public class AnYanClientExecutor implements AnYanClient {
|
|||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AuthResult queryPublicToken(){
|
@Override
|
||||||
|
public AuthResult publicNetworkTokenNoCache(){
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
String password = anYanProperties.getPublicPassWrod();
|
String password = anYanProperties.getPublicPassWrod();
|
||||||
String userName = anYanProperties.getPublicUserNmae();
|
String userName = anYanProperties.getPublicUserNmae();
|
||||||
@@ -222,10 +223,4 @@ public class AnYanClientExecutor implements AnYanClient {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String publicNetworkTokenNoCache(){
|
|
||||||
AuthResult authResult = queryPublicToken();
|
|
||||||
return null != authResult? authResult.getAccess_token() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+8
@@ -20,4 +20,12 @@ public class AuthResult {
|
|||||||
* token
|
* token
|
||||||
*/
|
*/
|
||||||
private String access_token;
|
private String access_token;
|
||||||
|
/**
|
||||||
|
* refresh_token
|
||||||
|
*/
|
||||||
|
private String refresh_token;
|
||||||
|
/**
|
||||||
|
* satoken
|
||||||
|
*/
|
||||||
|
private String satoken;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -283,7 +283,7 @@ public class LargeScreenNewController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("queryAnYanToken")
|
@GetMapping("queryAnYanToken")
|
||||||
public Result<String> queryAnYanToken(){
|
public Result<AuthResult> queryAnYanToken(){
|
||||||
return Result.ok(largeScreenService.queryAnYanToken());
|
return Result.ok(largeScreenService.queryAnYanToken());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -55,5 +55,5 @@ public interface ILargeScreenService extends IService<LargeScreenMap> {
|
|||||||
*/
|
*/
|
||||||
void syncAnYanHospital();
|
void syncAnYanHospital();
|
||||||
|
|
||||||
String queryAnYanToken();
|
AuthResult queryAnYanToken();
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -535,7 +535,7 @@ public class LargeScreenServiceImpl extends ServiceImpl<LargeScreenMapper, Large
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String queryAnYanToken(){
|
public AuthResult queryAnYanToken(){
|
||||||
return anYanClient.publicNetworkTokenNoCache();
|
return anYanClient.publicNetworkTokenNoCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user