12345678910111213141516171819202122 |
- package utils
- import "github.com/gin-gonic/gin"
- func SetBridgeLogListByClaims(c *gin.Context, logStr string) {
- bridgeLogList := GetBridgeLogListByClaims(c)
- bridgeLogList = append(bridgeLogList, logStr)
- c.Set("bridge_log", bridgeLogList)
- return
- }
- func GetBridgeLogListByClaims(c *gin.Context) (bridgeLogList []string) {
- claims, exists := c.Get("bridge_log")
- if !exists {
- bridgeLogList = []string{}
- return
- }
- bridgeLogList = claims.([]string)
- return
- }
|