|
@@ -11,6 +11,7 @@ import com.template.model.vo.JsonPayVo;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
+import java.util.Collections;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -106,6 +107,10 @@ public class WelcomePayController implements WelcomePayControllerAPI {
|
|
|
public static List<JsonPayVo> queryStudentPayInfo(String cardNo,String year) {
|
|
public static List<JsonPayVo> queryStudentPayInfo(String cardNo,String year) {
|
|
|
String timeStr = String.valueOf(System.currentTimeMillis());
|
|
String timeStr = String.valueOf(System.currentTimeMillis());
|
|
|
String token = querySign(timeStr);
|
|
String token = querySign(timeStr);
|
|
|
|
|
+ // 签名都拿不到,后面的请求必失败,直接降级
|
|
|
|
|
+ if (token == null || token.trim().isEmpty()) {
|
|
|
|
|
+ return Collections.emptyList();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
Map<String, String> tokenParams = new HashMap<>();
|
|
Map<String, String> tokenParams = new HashMap<>();
|
|
|
// tokenParams.put("sign", sds);
|
|
// tokenParams.put("sign", sds);
|
|
@@ -126,7 +131,7 @@ public class WelcomePayController implements WelcomePayControllerAPI {
|
|
|
return travelers;
|
|
return travelers;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static String querySign(String timestr){
|
|
|
|
|
|
|
+ private static String querySign(String timestr) {
|
|
|
String devId = "ncjt00001";
|
|
String devId = "ncjt00001";
|
|
|
|
|
|
|
|
Map<String, String> tokenParams = new HashMap<>();
|
|
Map<String, String> tokenParams = new HashMap<>();
|
|
@@ -134,7 +139,13 @@ public class WelcomePayController implements WelcomePayControllerAPI {
|
|
|
tokenParams.put("timestamp", timestr);
|
|
tokenParams.put("timestamp", timestr);
|
|
|
|
|
|
|
|
// wecode换取token
|
|
// wecode换取token
|
|
|
- String sign = HttpsClient.post(urlStr +"api/getSign", tokenParams);
|
|
|
|
|
|
|
+ String sign = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ sign = HttpsClient.post(urlStr + "api/getSign", tokenParams);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
return sign;
|
|
return sign;
|
|
|
}
|
|
}
|