wangchuanjin пре 4 година
родитељ
комит
c6616acd16
1 измењених фајлова са 9 додато и 0 уклоњено
  1. 9 0
      encrypt/encryptarticle.go

+ 9 - 0
encrypt/encryptarticle.go

@@ -18,6 +18,10 @@ var BSE2 = &SimpleEncrypt{Key: "TOP2017jianyu"}
 var ESE = &SimpleEncrypt{Key: "PEjy2018topnet"}
 var ESE2 = &SimpleEncrypt{Key: "TopnetJy2018Pe"}
 
+//首页
+var ISE = &SimpleEncrypt{Key: "Indexjy2021topnet"}
+var ISE2 = &SimpleEncrypt{Key: "TopnetJy2021Pe"}
+
 //通用加密
 func CommonEncodeArticle(stype string, keys ...string) (id string) {
 	switch stype {
@@ -27,7 +31,10 @@ func CommonEncodeArticle(stype string, keys ...string) (id string) {
 		id = BEncodeArticleId2ByCheck("B", BSE, BSE2, keys...)
 	case "mailprivate":
 		id = BEncodeArticleId2ByCheck("C", ESE, ESE2, keys...)
+	case "indexcontent":
+		id = BEncodeArticleId2ByCheck("D", ISE, ISE2, keys...)	
 	}
+
 	return
 }
 
@@ -40,6 +47,8 @@ func CommonDecodeArticle(stype string, id string) (res []string) {
 		res = BDecodeArticleId2ByCheck(id, BSE, BSE2)
 	case "mailprivate":
 		res = BDecodeArticleId2ByCheck(id, ESE, ESE2)
+	case "indexcontent":
+		res = BDecodeArticleId2ByCheck(id, ISE, ISE2)
 	}
 	return
 }