Browse Source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 3 years ago
parent
commit
0e345f135e
1 changed files with 13 additions and 0 deletions
  1. 13 0
      controllers/js/jsyb_controller.go

+ 13 - 0
controllers/js/jsyb_controller.go View File

@@ -479,6 +479,8 @@ func (c *JSybController) ReadCard() {
479 479
 	url := c.GetString("url")
480 480
 	c.TestGetBasBaseInit(fixmedins_code, secret_key, ak)
481 481
 	pCardInfo, pBusiCardInfo := c.GetBasBaseInfo()
482
+	pBusiCardInfo = Remove0000(pBusiCardInfo)
483
+	fmt.Println(pBusiCardInfo)
482 484
 	bas := strings.Split(pCardInfo, "|")
483 485
 	basNumber := bas[2]
484 486
 	card_sn := bas[3]
@@ -597,3 +599,14 @@ func DeleteExtraSpace(s string) string {
597 599
 	}
598 600
 	return string(s2)
599 601
 }
602
+
603
+func Remove0000(s string) string {
604
+	str := make([]rune, 0, len(s))
605
+	for _, v := range []rune(s) {
606
+		if v == 0 {
607
+			continue
608
+		}
609
+		str = append(str, v)
610
+	}
611
+	return string(str)
612
+}