enhance: move window.config to JSON, improve CSP format (#39236)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind
2026-09-05 08:50:43 +00:00
committed by GitHub
co-authored by wxiaoguang
parent efa69e7230
commit eb501f6b19
8 changed files with 72 additions and 50 deletions
+5 -2
View File
@@ -46,8 +46,11 @@ type Context struct {
TemplateContext TemplateContext
Render Render
PageData map[string]any // data used by JavaScript modules in one page, it's `window.config.pageData`
Render Render
// PageData is used by JavaScript modules, it is `window.config.pageData`.
// Deprecated: it was introduced for refactoring some legacy JS code, it should not be used in new code anymore.
PageData map[string]any
Cache cache.StringCache
Flash *middleware.Flash