|
|
@@ -110,20 +110,23 @@ public class CmsGptCarController {
|
|
|
if (selectCount > 0) {
|
|
|
throw BusinessRuntimeException.getInstance("请检验车队ID或账号是否已存在");
|
|
|
}
|
|
|
- String gptSession = chatGptAccountService.getGptSession(chatgptSession.getEmail(), chatgptSession.getPassword());
|
|
|
- chatgptSession.setIsCar(true);
|
|
|
- chatgptSession.setOfficialSession(gptSession);
|
|
|
+ String gptSession = null;
|
|
|
+ if (StrUtil.isBlank(chatgptSession.getOfficialSession())) {
|
|
|
+ gptSession = chatGptAccountService.getGptSession(chatgptSession.getEmail(), chatgptSession.getPassword());
|
|
|
+ chatgptSession.setIsCar(true);
|
|
|
+ chatgptSession.setOfficialSession(gptSession);
|
|
|
+ }
|
|
|
chatgptSessionMapper.insert(chatgptSession);
|
|
|
- if(StringUtils.isBlank(chatgptSession.getCarId())){
|
|
|
+ if (gptSession != null && StringUtils.isBlank(chatgptSession.getCarId())) {
|
|
|
JSONObject jsonObject = new JSONObject(gptSession);
|
|
|
String planType = jsonObject.getJSONObject("accountCheckInfo").getStr("plan_type");
|
|
|
if ("plus".equals(planType)) {
|
|
|
chatgptSession.setCarId("P" + chatgptSession.getId());
|
|
|
chatgptSession.setCarName("P" + chatgptSession.getId());
|
|
|
- }else if("team".equals(planType)) {
|
|
|
+ } else if ("team".equals(planType)) {
|
|
|
chatgptSession.setCarId("T" + chatgptSession.getId());
|
|
|
chatgptSession.setCarName("T" + chatgptSession.getId());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
chatgptSession.setCarId("P" + chatgptSession.getId());
|
|
|
chatgptSession.setCarName("P" + chatgptSession.getId());
|
|
|
chatgptSession.setIsPlus(0);
|