Parcourir la source

feat:缓存清除 返回值

wangshan il y a 1 an
Parent
commit
ea6ab89432
2 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 3 0
      src/jfw/front/shorturl.go
  2. 3 0
      src/jfw/modules/app/src/app/front/shorturl.go

+ 3 - 0
src/jfw/front/shorturl.go

@@ -107,6 +107,9 @@ func (s *Short) ClearCache() {
 		cacheIndex = []byte{}
 	}
 	log.Println("after cacheIndex:", string(cacheIndex))
+	s.ServeJson(map[string]interface{}{
+		"state": len(cacheIndex),
+	})
 }
 
 func (s *Short) WhiteList() error {

+ 3 - 0
src/jfw/modules/app/src/app/front/shorturl.go

@@ -88,6 +88,9 @@ func (s *Short) ClearCache() {
 		cacheIndex = []byte{}
 	}
 	log.Println("after cacheIndex:", string(cacheIndex))
+	s.ServeJson(map[string]interface{}{
+		"state": len(cacheIndex),
+	})
 }
 
 func (s *Short) WhiteList() error {