| | |
| | | JSONObject data = JSONObject.fromObject(resultStr);
|
| | | if (data.optJSONObject("tbk_tpwd_create_response").optJSONObject("data") != null)
|
| | | return data.optJSONObject("tbk_tpwd_create_response").optJSONObject("data").optString("model");
|
| | | return null;
|
| | | }
|
| | |
|
| | | public static String getTKToken(String logo, String text, String url, boolean simpleToken) {
|
| | | if (simpleToken) {
|
| | | return getSimpleTKToken(logo, text, url);
|
| | | } else {
|
| | | return getTKToken(logo, text, url);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public static String getSimpleTKToken(String logo, String text, String url) {
|
| | | if (text == null)
|
| | | return null;
|
| | | if (text.length() < 5)
|
| | | text = "好货:" + text;
|
| | |
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.tpwd.create");
|
| | | map.put("url", url);
|
| | | map.put("text", text);
|
| | | map.put("logo", logo);
|
| | | String resultStr = TaoKeBaseUtil.baseRequestForThreeTimes(map, true);
|
| | |
|
| | | JSONObject data = JSONObject.fromObject(resultStr);
|
| | | if (data.optJSONObject("tbk_tpwd_create_response").optJSONObject("data") != null)
|
| | | return data.optJSONObject("tbk_tpwd_create_response").optJSONObject("data").optString("password_simple");
|
| | | return null;
|
| | | }
|
| | |
|