|
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.time.Instant;
|
|
|
+import java.util.Date;
|
|
|
|
|
|
@Component
|
|
|
@Slf4j
|
|
@@ -23,10 +24,8 @@ public class SignInterceptor implements Interceptor<JSONObject> {
|
|
|
@Override
|
|
|
public void onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args) {
|
|
|
JSONObject playload = new JSONObject();
|
|
|
- Instant now = Instant.now();
|
|
|
- long epochSecond = now.getEpochSecond();
|
|
|
playload.put("appId", manageConfig.getAppid());
|
|
|
- playload.put("timestamp", epochSecond);
|
|
|
+ playload.put("timestamp", new Date().getTime());
|
|
|
request.addHeader("sign", RsaUtils.encipher(playload.toJSONString(),manageConfig.getPublicKey()));
|
|
|
request.addHeader("appId", manageConfig.getAppid());
|
|
|
|