Преглед изворни кода

新增gpt自动修改 密码

chenbiao пре 1 година
родитељ
комит
1d941a4a15

+ 7 - 6
netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsGptCarController.java

@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
 import com.alibaba.excel.support.ExcelTypeEnum;
@@ -164,15 +165,15 @@ public class CmsGptCarController {
 		if(chatgptSession == null){
 			throw BusinessRuntimeException.getInstance("车队不存在");
 		}
-		JSONObject jsonData = new JSONObject();
-		jsonData.put("url", chatGptChangePasswordDto.getUrl());
+
+		HttpRequest request = HttpRequest.post("http://85.113.70.93:8282/change");
+		request.form("url", chatGptChangePasswordDto.getUrl());
 		if(StringUtils.isBlank(chatGptChangePasswordDto.getPassword())){
 			chatGptChangePasswordDto.setPassword(RandomUtil.randomString(12));
 		}
-		jsonData.put("newpassword", chatGptChangePasswordDto.getPassword());
-		jsonData.put("proxy", "http://nKeghbxuT2R2QO7G:2pSJmJSZln2CPGJ2_country-us@geo.iproyal.com:12321");
-		String body = HttpUtil.post("http://85.113.70.93:8282/change", jsonData.toString());
-		// Parse response
+		request.form("newpassword", chatGptChangePasswordDto.getPassword());
+		request.form("proxy", "nKeghbxuT2R2QO7G:2pSJmJSZln2CPGJ2_country-us_streaming-1@geo.iproyal.com:12321");
+		String body = request.execute().body();
 		JSONObject jsonResponse = new JSONObject(body);
 		int code = jsonResponse.getInt("code");