Files
ezbookkeeping/pkg/middlewares/amap_api_proxy_auth_cookie.go
T
2025-07-24 23:58:24 +08:00

13 lines
397 B
Go

package middlewares
import (
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/settings"
)
// AmapApiProxyAuthCookie adds amap api proxy auth cookie to cookies in response
func AmapApiProxyAuthCookie(c *core.WebContext, config *settings.Config) {
token := c.GetTextualToken()
c.SetTokenStringToCookie(token, int(config.TokenExpiredTime), "/_AMapService")
}