chenbiao hace 2 años
padre
commit
1cc04139d8

+ 2 - 1
netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAccountServiceImpl.java

@@ -3,6 +3,7 @@ package com.cyksj.service.chatgpt.impl;
 import cn.hutool.core.lang.UUID;
 import cn.hutool.core.lang.UUID;
 import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpResponse;
 import cn.hutool.http.HttpResponse;
+import cn.hutool.http.Method;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.exception.BusinessRuntimeException;
@@ -62,7 +63,7 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService{
            request.form("username", account.getAccount());
            request.form("username", account.getAccount());
            request.form("password", account.getPassword());
            request.form("password", account.getPassword());
            request.header("Content-Type","application/x-www-form-urlencoded");
            request.header("Content-Type","application/x-www-form-urlencoded");
-           HttpResponse execute = request.execute();
+           HttpResponse execute = request.method(Method.POST).execute();
            JSONObject loginResult = new JSONObject(execute.body());
            JSONObject loginResult = new JSONObject(execute.body());
            //detail
            //detail
            if (StringUtils.isBlank(loginResult.getStr("accessToken"))) {
            if (StringUtils.isBlank(loginResult.getStr("accessToken"))) {