Просмотр исходного кода

fix: 修复日志翻页问题 (close #122)

CaIon 2 лет назад
Родитель
Сommit
f65477d054
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      service/midjourney.go
  2. 1 1
      web/src/components/LogsTable.js

+ 1 - 1
service/midjourney.go

@@ -193,7 +193,7 @@ func DoMidjourneyHttpRequest(c *gin.Context, timeout time.Duration, fullRequestU
 		return MidjourneyErrorWithStatusCodeWrapper(constant.MjErrorUnknown, "do_request_failed", http.StatusInternalServerError), nullBytes, err
 		return MidjourneyErrorWithStatusCodeWrapper(constant.MjErrorUnknown, "do_request_failed", http.StatusInternalServerError), nullBytes, err
 	}
 	}
 	statusCode := resp.StatusCode
 	statusCode := resp.StatusCode
-	//if statusCode != 200 {
+	//if statusCode != 200  {
 	//	return MidjourneyErrorWithStatusCodeWrapper(constant.MjErrorUnknown, "bad_response_status_code", statusCode), nullBytes, nil
 	//	return MidjourneyErrorWithStatusCodeWrapper(constant.MjErrorUnknown, "bad_response_status_code", statusCode), nullBytes, nil
 	//}
 	//}
 	err = req.Body.Close()
 	err = req.Body.Close()

+ 1 - 1
web/src/components/LogsTable.js

@@ -265,7 +265,7 @@ const LogsTable = () => {
     setActivePage(page);
     setActivePage(page);
     if (page === Math.ceil(logs.length / pageSize) + 1) {
     if (page === Math.ceil(logs.length / pageSize) + 1) {
       // In this case we have to load more data and then append them.
       // In this case we have to load more data and then append them.
-      loadLogs(page - 1, pageSize).then(r => {
+      loadLogs(page - 1, pageSize, logType).then(r => {
       });
       });
     }
     }
   };
   };