docs: update mj-plus api domain

This commit is contained in:
RockYang
2024-02-23 15:41:02 +08:00
parent db6ed84451
commit a80cd3848e
3 changed files with 6 additions and 4 deletions

View File

@@ -90,8 +90,10 @@ func (c *Client) Imagine(task types.MjTask) (ImageRes, error) {
SetErrorResult(&errRes).
Post(apiURL)
if err != nil {
errStr, _ := io.ReadAll(r.Body)
logger.Errorf("API 返回:%s, API URL: %s", string(errStr), apiURL)
if r.Body != nil {
errStr, _ := io.ReadAll(r.Body)
logger.Errorf("API 返回:%s, API URL: %s", string(errStr), apiURL)
}
return ImageRes{}, fmt.Errorf("请求 API 出错:%v", err)
}