|
@@ -22,7 +22,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
-import java.time.Instant;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -62,11 +61,9 @@ public class SignVerificationAspect {
|
|
}
|
|
}
|
|
|
|
|
|
//通过appid查询私钥
|
|
//通过appid查询私钥
|
|
- Instant now = Instant.now();
|
|
|
|
- long epochSecond = now.getEpochSecond();
|
|
|
|
JSONObject playload = new JSONObject();
|
|
JSONObject playload = new JSONObject();
|
|
playload.put("appId", ucenterAppId);
|
|
playload.put("appId", ucenterAppId);
|
|
- playload.put("timestamp", epochSecond);
|
|
|
|
|
|
+ playload.put("timestamp", System.currentTimeMillis());
|
|
String ucenterSign = RsaUtils.encipher(playload.toJSONString(), publicKey);
|
|
String ucenterSign = RsaUtils.encipher(playload.toJSONString(), publicKey);
|
|
Map<String, String> headerMap = new HashMap<>();
|
|
Map<String, String> headerMap = new HashMap<>();
|
|
headerMap.put("sign", ucenterSign);
|
|
headerMap.put("sign", ucenterSign);
|