util.go 358 B

1234567891011121314151617181920212223
  1. package util
  2. import (
  3. "app.yhyue.com/moapp/jybase/encrypt"
  4. )
  5. var Date_Full_Layout = "2006-01-02 15:04:05"
  6. //加密
  7. func EncodeId(sid string) string {
  8. if sid == "" {
  9. return ""
  10. }
  11. return encrypt.EncodeArticleId2ByCheck(sid)
  12. }
  13. //解密
  14. func DecodeId(eid string) string {
  15. if eid == "" {
  16. return ""
  17. }
  18. return encrypt.DecodeArticleId2ByCheck(eid)[0]
  19. }