sun-pc-linux 1 month ago
parent
commit
3659ea53aa
2 changed files with 5 additions and 9 deletions
  1. 4 8
      sku3d/sku3d/api/a-service-img.go
  2. 1 1
      sku3d/sku3d/test/index.html

+ 4 - 8
sku3d/sku3d/api/a-service-img.go

@@ -6,6 +6,7 @@ import (
 	"sku3dweb/db/model"
 	"sku3dweb/db/repo"
 	"sku3dweb/log"
+	"strings"
 	"time"
 
 	"github.com/gin-gonic/gin"
@@ -115,16 +116,11 @@ func createImg(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 }
 
 func SearchByImg(c *gin.Context, apictx *ApiSession) (interface{}, error) {
-
-	data := &struct {
-		Url string
-	}{}
-	err := c.ShouldBindJSON(data)
-	if err != nil || len(data.Url) < 1 {
+	url := c.Query("url")
+	if !strings.Contains(url, "http") {
 		return nil, NewError("参数错误")
 	}
-
-	images, err := QueryFassiImage(data.Url)
+	images, err := QueryFassiImage(url)
 	if err != nil {
 		return nil, err
 	}

+ 1 - 1
sku3d/sku3d/test/index.html

@@ -150,7 +150,7 @@
 
             try {
                 const response = await fetch(`${baseUrl}/image/fassi/list`, {
-                    method: 'GET',
+                    method: 'POST',
                     headers: {
                         'Authorization': token,
                         'Content-Type': 'application/json'