🎨 完善st兼容 && 完善支持前端卡

This commit is contained in:
2026-03-13 20:27:11 +08:00
parent 4cecfd6589
commit 5ca65e3004
7 changed files with 256 additions and 61 deletions

View File

@@ -426,7 +426,8 @@ func (s *RegexScriptService) ExtractMaintext(text string) (string, string) {
func (s *RegexScriptService) GetScriptsForPlacement(userID uint, placement int, charID *uint, presetID *uint) ([]app.RegexScript, error) {
var scripts []app.RegexScript
db := global.GVA_DB.Where("user_id = ? AND placement = ? AND disabled = ?", userID, placement, false)
// markdownOnly=true 脚本只在前端显示层执行,后端不应用
db := global.GVA_DB.Where("user_id = ? AND placement = ? AND disabled = ? AND markdown_only = ?", userID, placement, false, false)
// 作用域过滤:全局(0) 或 角色(1) 或 预设(2)
// 使用参数化查询避免 SQL 注入