|
|
@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import com.yxt.ss.gateway.api.ClientService; |
|
|
|
import com.yxt.ss.gateway.api.utils.ResultBean; |
|
|
|
import com.yxt.ss.gateway.api.utils.SignatureQuery; |
|
|
|
import com.yxt.ss.gateway.api.utils.SignatureUtil; |
|
|
|
import okhttp3.*; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
@ -34,8 +33,6 @@ public class ClientRest { |
|
|
|
|
|
|
|
//appkey
|
|
|
|
static final String APPKEY = "appKey4"; |
|
|
|
//secret
|
|
|
|
static final String SECRET = "secret"; |
|
|
|
|
|
|
|
//开发端,生成签名并调用服务器端验证签名、appKey等值。
|
|
|
|
@PostMapping("/getSign") |
|
|
@ -49,7 +46,7 @@ public class ClientRest { |
|
|
|
tree.put("_t", String.valueOf(System.currentTimeMillis() / 1000)); |
|
|
|
tree.put("_s", ""); |
|
|
|
// 生成签名
|
|
|
|
String sign = clientService.generateSignature(tree, SECRET); |
|
|
|
String sign = clientService.generateSignature(tree); |
|
|
|
//添加签名值map
|
|
|
|
tree.put("_sign", sign); |
|
|
|
//发起请求
|
|
|
|