Selaa lähdekoodia

首页三级页加密

zhangxinlei1996 4 vuotta sitten
vanhempi
commit
ed2ed62bc8
1 muutettua tiedostoa jossa 9 lisäystä ja 1 poistoa
  1. 9 1
      src/qfw/util/encryptarticle.go

+ 9 - 1
src/qfw/util/encryptarticle.go

@@ -17,6 +17,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 {
@@ -26,6 +30,8 @@ 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
 }
@@ -33,12 +39,14 @@ func CommonEncodeArticle(stype string, keys ...string) (id string) {
 //通用解密
 func CommonDecodeArticle(stype string, id string) (res []string) {
 	switch stype {
-	case "content", "indexcontent":
+	case "content":
 		res = BDecodeArticleId2ByCheck(id, SE, SE2)
 	case "bdprivate":
 		res = BDecodeArticleId2ByCheck(id, BSE, BSE2)
 	case "mailprivate":
 		res = BDecodeArticleId2ByCheck(id, ESE, ESE2)
+	case "indexcontent":
+		res = BDecodeArticleId2ByCheck(id, ISE, ISE2)
 	}
 	return
 }