Explorar o código

修复文件路径错误

lijian %!s(int64=6) %!d(string=hai) anos
pai
achega
94e7472b55
Modificáronse 2 ficheiros con 4 adicións e 3 borrados
  1. 3 2
      pkg/models/product.go
  2. 1 1
      services/fileaccess/fileaccess.go

+ 3 - 2
pkg/models/product.go

@@ -22,8 +22,9 @@ type Product struct {
 	ProductConfig string `sql:"type:text; not null;"`
 	// icon of product
 	ProductImage string
-	ProductType  int
-	Devices      []Device
+	// product class
+	ProductType string
+	Devices     []Device
 }
 
 // Validate 验证

+ 1 - 1
services/fileaccess/fileaccess.go

@@ -190,7 +190,7 @@ func (f *FileAccess) MoveFile(args *rpcs.ArgsMoveFile, reply *rpcs.ReplyMoveFile
 		io.Copy(destination, source)
 		fpath := fmt.Sprintf("http://%s/%s/%s/%s", server.GetHTTPHost(), *conStaticPath, args.Target, fileName)
 		if *conDomain != "" {
-			fpath = fmt.Sprintf("http://%s/%s/%s/%s", *conDomain, *conStaticPath, args.Target, fileName)
+			fpath = fmt.Sprintf("%s/%s/%s/%s", *conDomain, *conStaticPath, args.Target, fileName)
 		}
 		reply.FilePath = fpath
 		//delete src