|
@@ -195,7 +195,8 @@ public class AmzTokenServiceImpl implements AmzTokenService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public Result<String> getAmzTokenByLwaCode(GetAmzTokenByLwaCodeVo gatblcVo) throws Exception {
|
|
|
|
|
|
+ public Result<String>
|
|
|
|
+ getAmzTokenByLwaCode(GetAmzTokenByLwaCodeVo gatblcVo) throws Exception {
|
|
Result<String> rt = new Result<>();
|
|
Result<String> rt = new Result<>();
|
|
// 设置请求头
|
|
// 设置请求头
|
|
HttpHeaders headers = new HttpHeaders();
|
|
HttpHeaders headers = new HttpHeaders();
|
|
@@ -254,18 +255,27 @@ public class AmzTokenServiceImpl implements AmzTokenService {
|
|
* @param maps
|
|
* @param maps
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
- public void saveAmzToken(Map maps)throws Exception{
|
|
|
|
|
|
+ public String saveAmzToken(Map maps)throws Exception{
|
|
log.info("======start=====saveAmzToken");
|
|
log.info("======start=====saveAmzToken");
|
|
try{
|
|
try{
|
|
log.info("=====refshtoken====start");
|
|
log.info("=====refshtoken====start");
|
|
Map reqMaps = new HashMap();
|
|
Map reqMaps = new HashMap();
|
|
|
|
+ if (maps == null || maps.isEmpty()) {
|
|
|
|
+ return "maps字段为空";
|
|
|
|
+ }
|
|
reqMaps.put("grant_type","authorization_code");
|
|
reqMaps.put("grant_type","authorization_code");
|
|
String code = (String) maps.get("spapi_oauth_code");
|
|
String code = (String) maps.get("spapi_oauth_code");
|
|
|
|
+ if (code == null) {
|
|
|
|
+ return "spapi_oauth_code字段为空";
|
|
|
|
+ }
|
|
reqMaps.put("code",code);
|
|
reqMaps.put("code",code);
|
|
reqMaps.put("client_id",Constant.CLIENTID);
|
|
reqMaps.put("client_id",Constant.CLIENTID);
|
|
reqMaps.put("client_secret",Constant.CLIENTSECRET);
|
|
reqMaps.put("client_secret",Constant.CLIENTSECRET);
|
|
//state 转换uuid
|
|
//state 转换uuid
|
|
String state = (String) maps.get("state");
|
|
String state = (String) maps.get("state");
|
|
|
|
+ if (state == null) {
|
|
|
|
+ return "state字段为空";
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
//用于获取refshtoken
|
|
//用于获取refshtoken
|
|
@@ -310,6 +320,7 @@ public class AmzTokenServiceImpl implements AmzTokenService {
|
|
}catch(Exception e){
|
|
}catch(Exception e){
|
|
log.info("saveAmzToken====系统异常",e);
|
|
log.info("saveAmzToken====系统异常",e);
|
|
}
|
|
}
|
|
|
|
+ return "success";
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|