|
|
@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
import cn.hutool.http.Method;
|
|
|
+import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
@@ -258,9 +259,18 @@ public class SpotifyServiceImpl implements SpotifyService {
|
|
|
proxyInfos.remove(proxyInfo);
|
|
|
continue;
|
|
|
}
|
|
|
+ //{"error":{"error_details":{"code":1,"invalid_argument":{"field_errors":[{"code":6,"message":"你的密码安全强度太低。设置安全强度较高的密码。","field":"FIELD_PASSWORD"}]},"title":"请检查你的详细信息,然后再试一次。"}}}
|
|
|
//{"error":{"error_details":{"code":2,"title":"请检查你的详细信息,然后再试一次。","body":"此电子邮件已关联至某个帐号。请登录你的帐号,或使用其他电子邮件注册。","already_exists":{}}}}
|
|
|
- registerOrderDon.setErrorMsg(error_details.getStr("body"));
|
|
|
- registerOrderDon.setStatus(RegisterOrderDon.Status.error);
|
|
|
+ if(code == 1 || error_details.getJSONObject("invalid_argument") != null){
|
|
|
+ JSONObject invalid_argument = error_details.getJSONObject("invalid_argument") ;
|
|
|
+ JSONArray field_errors = invalid_argument.getJSONArray("field_errors");
|
|
|
+ JSONObject errmsg = (JSONObject)field_errors.get(0);
|
|
|
+ registerOrderDon.setErrorMsg(errmsg.getStr("message"));
|
|
|
+ registerOrderDon.setStatus(RegisterOrderDon.Status.error);
|
|
|
+ }else {
|
|
|
+ registerOrderDon.setErrorMsg(error_details.getStr("body"));
|
|
|
+ registerOrderDon.setStatus(RegisterOrderDon.Status.error);
|
|
|
+ }
|
|
|
registerOrderDonMapper.updateById(registerOrderDon);
|
|
|
|
|
|
//注册失败发放模板消息
|