renzheng 8 năm trước cách đây
mục cha
commit
e09a315512

+ 2 - 2
common/src/qfw/util/common.go

@@ -231,8 +231,8 @@ func Float64All(num interface{}) float64 {
 	} else if i3, ok3 := num.(float32); ok3 {
 		return float64(i3)
 	} else if i4, ok4 := num.(string); ok4 {
-		in, _ := strconv.Atoi(i4)
-		return float64(in)
+		in, _ := strconv.ParseFloat(i4, 64)
+		return in
 	} else if i5, ok5 := num.(int16); ok5 {
 		return float64(i5)
 	} else if i6, ok6 := num.(int8); ok6 {

+ 9 - 11
common/src/qfw/util/encrypt_test.go

@@ -5,16 +5,14 @@ import (
 	"testing"
 )
 
-
 //加密解密测试
 func TestEncrypt(t *testing.T) {
-	se := SimpleEncrypt{Key: "topnet"}
-	mw:=se.EncodeString("hello world")
-	log.Println("密文",mw)
-	txt:=se.DecodeString("HAocAgpUAwACAgEA3g=1")
-	log.Println("解密后:",txt)
-	mw2:=se.Encode2Hex("hello world")
-	log.Println("16进制密文",mw2)
-	log.Println("解密16进制",se.Decode4Hex(mw2))
-	}
-
+	se := SimpleEncrypt{Key: "topnet2015topnet2015"}
+	mw := se.EncodeString("58db529161a0721f1553446a,123444")
+	log.Println("密文", mw)
+	txt := se.DecodeString("QVcUDFBGCwEHBBVfR1xUEgMFBAZAW0YP")
+	log.Println("解密后:", txt)
+	mw2 := se.Encode2Hex("hello world")
+	log.Println("16进制密文", mw2)
+	log.Println("解密16进制", se.Decode4Hex(mw2))
+}

+ 1 - 1
common/src/qfw/util/mongodb/mongodbSim.go

@@ -294,7 +294,7 @@ func (m *MongodbSim) Find(c string, query interface{}, order interface{}, fields
 			err = coll.Find(ObjToM(query)).Select(ObjToOth(fields)).Sort(ObjToArr(order)...).All(&res)
 		}
 		if nil != err {
-			log.Println("FindError", err)
+			//log.Println("FindError", err)
 		}
 		b = true
 	}

+ 2 - 1
core/src/qfw/filemanage/filemanage.go

@@ -4,9 +4,10 @@
 package filemanage
 
 import (
-	"github.com/go-xweb/xweb"
 	"qfw/coreconfig"
 	"strings"
+
+	"github.com/go-xweb/xweb"
 )
 
 var FileType []string